branch: externals/org-remark
commit 067681278fed0313c201f60d8ff4b1f7ca8b54c0
Author: Noboru Ota <m...@nobiot.com>
Commit: Noboru Ota <m...@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