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

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

[elpa] externals/org-remark 4e28dd1923 092/173: add: load works with a d


From: ELPA Syncer
Subject: [elpa] externals/org-remark 4e28dd1923 092/173: add: load works with a different pen
Date: Fri, 28 Jan 2022 16:58:04 -0500 (EST)

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

    add: load works with a different pen
    
    WIP highlight's data signature changed
    
        (id (beg . end))
    
    to
    
        (id (beg . end) label)
    
    This changes how to access it -- it's no longer a cons cell.
    
    Need to document it
---
 org-marginalia.el | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/org-marginalia.el b/org-marginalia.el
index 01f3c0ab8d..dfb1381cf6 100644
--- a/org-marginalia.el
+++ b/org-marginalia.el
@@ -283,21 +283,26 @@ buffer or quit Emacs. When you re-launch Emacs, ensure to 
turn on
                ;; H1: File
                ;; H2: Higlighted region (each one has a dedicated H2 subtree)
                (while (not (org-next-visible-heading 1))
-                (when-let ((id (org-entry-get (point) "marginalia-id"))
-                            (beg (string-to-number
-                                 (org-entry-get (point)
-                                                "marginalia-source-beg")))
-                            (end (string-to-number
-                                 (org-entry-get (point)
-                                                "marginalia-source-end"))))
-                   (push (cons id (cons beg end)) highlights)))))))
+                (let ((id (org-entry-get (point) "marginalia-id"))
+                       (beg (string-to-number
+                            (org-entry-get (point)
+                                           "marginalia-source-beg")))
+                       (end (string-to-number
+                            (org-entry-get (point)
+                                           "marginalia-source-end")))
+                       (label (org-entry-get (point)
+                                             "org-marginalia-label")))
+                   (when id (push (list id (cons beg end) label) 
highlights))))))))
        ;; Back to the current buffer
        ;; Look highilights and add highlights to the current buffer
        (dolist (highlight highlights)
           (let ((id (car highlight))
-               (beg (car (cdr highlight)))
-               (end (cdr (cdr highlight))))
-            (org-marginalia-mark beg end id)))))
+               (beg (caadr highlight))
+               (end (cdadr highlight))
+                (label (caddr highlight)))
+            (let ((fn (intern (concat "org-marginalia-mark-" label))))
+              (unless (functionp fn) (setq fn #'org-marginalia-mark))
+              (funcall fn beg end id))))))
     ;; Tracking
     (when org-marginalia-global-tracking-mode
       (add-to-list 'org-marginalia-files-tracked



reply via email to

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