emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org-remark ad0c5e39c2 09/37: refactor: org-remark-notes


From: ELPA Syncer
Subject: [elpa] externals/org-remark ad0c5e39c2 09/37: refactor: org-remark-notes-setup
Date: Sat, 14 Jan 2023 10:58:00 -0500 (EST)

branch: externals/org-remark
commit ad0c5e39c2ee9c87bac51701bd1b74c9ee9afa1b
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>

    refactor: org-remark-notes-setup
    
    Made it explictly looks for the base buffer of notes.  Docs updated
    accordingly.
---
 org-remark.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/org-remark.el b/org-remark.el
index 54f899fdbb..e953481410 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -1080,12 +1080,15 @@ properties, add prefix \"*\"."
       full-text)))
 
 (defun org-remark-notes-setup (notes-buf source-buf)
-  ;;; Start tracking the source buffer in the notes buffer as local variable.
-  ;;; This adds variable only to the base-buffer and not to the indrect buffer.
-  (with-current-buffer notes-buf
-    (unless (member source-buf org-remark-notes-source-buffers)
-      (cl-pushnew source-buf org-remark-notes-source-buffers)
-      (add-hook 'after-save-hook #'org-remark-notes-sync-with-source nil 
:local)))
+  "Set up NOTES-BUF and SOURCE-BUF for sync.
+
+Note that this function adds some local variables only to the
+base-buffer of the notes and not to the indirect buffer."
+  (let ((base-buf (or (buffer-base-buffer notes-buf) notes-buf)))
+    (with-current-buffer base-buf
+      (unless (member source-buf org-remark-notes-source-buffers)
+        (cl-pushnew source-buf org-remark-notes-source-buffers)
+        (add-hook 'after-save-hook #'org-remark-notes-sync-with-source nil 
:local))))
   (with-current-buffer source-buf
     (setq org-remark-source-setup-done t)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]