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

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

[elpa] externals/org-remark 067681278f 038/173: fix: next/prev was rever


From: ELPA Syncer
Subject: [elpa] externals/org-remark 067681278f 038/173: fix: next/prev was reversed
Date: Fri, 28 Jan 2022 16:57:57 -0500 (EST)

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

    fix: next/prev was reversed
    
    mapcar keeps the original order, but dolist + push reverses the order of the
    resultant list. dolist was used in order to eliminate `nil` elements as 
mapcar
    keeps it (it should, as the number of elements should be identical for
    map). Now the `nil` is removed with fn `remove`; to me this more intuitive
    than dolist.
---
 org-marginalia.el | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/org-marginalia.el b/org-marginalia.el
index 7e64e1b268..2848814cb1 100644
--- a/org-marginalia.el
+++ b/org-marginalia.el
@@ -481,14 +481,13 @@ visible ones.
 
 If none, return nil."
   (when om/highlights
-    (let ((list '()))
-      (dolist (h om/highlights)
-        (org-with-wide-buffer
-         (let ((p (marker-position (car (cdr h)))))
-           (unless (car (get-char-property-and-overlay p 'invisible))
-             (push p list)))))
-      (when list
-        (if reverse (reverse list) list)))))
+     (when om/highlights
+       (let ((list (mapcar (lambda (h)
+                             (marker-position (car (cdr h))))
+                           om/highlights)))
+         (remove nil list)
+         (when list
+           (if reverse (reverse list) list))))))
 
 (defun om/sort-highlights-list ()
   "Utility function to sort `om/sort-highlights'."



reply via email to

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