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

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

[elpa] externals/org-remark d58e8f256c 012/173: break: Change om/save-al


From: ELPA Syncer
Subject: [elpa] externals/org-remark d58e8f256c 012/173: break: Change om/save-all to om/save
Date: Fri, 28 Jan 2022 16:57:54 -0500 (EST)

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

    break: Change om/save-all to om/save
---
 README.org        |  6 +++---
 org-marginalia.el | 21 +++++++++++----------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/README.org b/README.org
index c87e0d150a..1e8e724b36 100644
--- a/README.org
+++ b/README.org
@@ -64,13 +64,13 @@ For example, I use this in my init file. Org-marginalia is 
a local minor mode. A
 :END:
 
 - =org-marginalia-mode= ::
-Org-marginalia is a local minor mode. Toggle it on/off with using 
=org-marginalia-mode=. On activating, it loads your saved highlights from the 
marginalia file, and enables automatic saving of highlights. The automatic 
saving is achieved via function =om/save-all= added to =after-save-hook=.
+Org-marginalia is a local minor mode. Toggle it on/off with using 
=org-marginalia-mode=. On activating, it loads your saved highlights from the 
marginalia file, and enables automatic saving of highlights. The automatic 
saving is achieved via function =om/save= added to =after-save-hook=.
 
 - =om/mark= (=C-c m= by default) ::
 Select a region of text, and call =om/mark= to highlight the region. It will 
generate a new ID, and start tracking the location -- so you can edit text 
around the marked text. Do not copy and paste as it will disappear and it is a 
bit tricky to recover the highlights. To create a new margin note entry in the 
marginalia file, save the buffer.
 
-- =om/save-all= ::
-By default, Org-marginalia creates or updates the highlight's location and 
text inside automatically in the marginalia file. You can manually call 
=om/save-all= to manually do it (automatic process also call this command).
+- =om/save= ::
+By default, Org-marginalia automatically creates or updates corresponding 
entries in the marginalia file with location and text of highlights on saving 
the buffer. Nevertheless, you can manually call =om/save= to do so (automatic 
process also call this command).
 
 - =om/open-at-point= (=C-c n o= by default) ::
 Move your cursor on the highlighted text, and call =om/open-at-point= to open 
the relevant margin notes in a separate window. Your cursor should move to the 
marginalia buffer narrowed to the relevant margin notes entry. You can edit the 
margin notes as a normal Org file. Once you have done editing, you can simply 
save and close the buffer (kill or close the window) as per your normal 
workflow. Technically, the marginalia buffer is a cloned indirect buffer of the 
marginalia file. 
diff --git a/org-marginalia.el b/org-marginalia.el
index d1f8b3ab68..4ccbf5f0a2 100644
--- a/org-marginalia.el
+++ b/org-marginalia.el
@@ -50,7 +50,7 @@
 ;; - =org-marginalia-mode= :: Org-marginalia is a local minor mode. Toggle it
 ;; on/off with using =org-marginalia-mode=. On activating, it loads your saved
 ;; highlighters from the marginalia file, and enables automatic saving of
-;; highlighters. The automatic saving is achieved via function =om/save-all=
+;; highlighters. The automatic saving is achieved via function =om/save=
 ;; added to =after-save-hook=.
 
 ;; - =om/mark= :: Select a region of text, and call =om/mark= (bound to =C-c n
@@ -60,9 +60,9 @@
 ;; recover the highlighter. To create a new margin note entry in the
 ;; marginalia file, save the buffer.
 
-;; - =om/save-all= :: By default, Org-marginalia creates or updates the
+;; - =om/save= :: By default, Org-marginalia creates or updates the
 ;; highlighter's location and text inside automatically in the marginalia
-;; file. You can manually call =om/save-all= to manually do it (automatic
+;; file. You can manually call =om/save= to manually do it (automatic
 ;; process also call this command).
 
 ;; - =om/open-at-point= :: Move your cursor on the highlighted text, and call
@@ -184,7 +184,7 @@ It is meant to exist only one of these in each Emacs 
session.")
 (defun om/mark (beg end &optional id)
   "Highlight the selected region (BEG and END) when used interactively.
 It will generate a new ID, and start tracking the location, but
-will not create a marginalia entry yet. Call `om/save-all' to
+will not create a marginalia entry yet. Call `om/save' to
 create a new entry (it is automatic with `after-save-hook').
 
 When this function is called from Elisp, ID can be optionally
@@ -211,7 +211,7 @@ beginning point; this should be useful when `om/next' and
   (om/sort-highlights-list))
 
 ;;;###autoload
-(defun om/save-all ()
+(defun om/save ()
   "Save all the highlights tracked in current buffer to marginalia file.
 The marginalia file is defined in `om/notes-file-path' variable.
 
@@ -228,7 +228,8 @@ current buffer. Each highlight is represented by this data 
structure:
          (source-path (abbreviate-file-name filename))
          (title (or (car (cdr (assoc "TITLE" (org-collect-keywords 
'("TITLE")))))
                     (file-name-sans-extension (file-name-nondirectory 
(buffer-file-name))))))
-    (dolist (highlight om/highlights) (om/save highlight title source-path))))
+    (dolist (highlight om/highlights)
+      (om/save-single-highlight highlight title source-path))))
 
 ;;;###autoload
 (defun om/open-at-point (point)
@@ -338,7 +339,7 @@ text file in Org Mode.
 It loads your saved highlighters from the marginalia file, and
 enables automatic saving of highlighters.
 
-The automatic saving is achieved via function `om/save-all' added
+The automatic saving is achieved via function `om/save' added
 to `after-save-hook'.
 
 Interactively with no argument, this command toggles the mode. A
@@ -356,16 +357,16 @@ the mode, `toggle' toggles the state."
      (org-marginalia-mode
       ;; Activate
       (om/load)
-      (add-hook 'after-save-hook #'om/save-all nil t))
+      (add-hook 'after-save-hook #'om/save nil t))
      (t
       ;; Deactivate
-      (remove-hook 'after-save-hook #'om/save-all t))))
+      (remove-hook 'after-save-hook #'om/save t))))
 
 ;;;; Functions
 
 ;;;;; Private
 
-(defun om/save (highlight title source-path)
+(defun om/save-single-highlight (highlight title source-path)
   "Save a single HIGHLIGHT in the marginalia file with properties.
 The marginalia file is specified by SOURCE-PATH. If headline with
 the same ID already exists, update it based on the new highlight



reply via email to

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