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

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

[nongnu] elpa/symbol-overlay f18493673d 6/6: Merge pull request #86 from


From: ELPA Syncer
Subject: [nongnu] elpa/symbol-overlay f18493673d 6/6: Merge pull request #86 from ksqsf/master
Date: Thu, 15 Dec 2022 12:59:40 -0500 (EST)

branch: elpa/symbol-overlay
commit f18493673d1c9870f6b44e2dbdbe8b0b739d1526
Merge: dc9f5f1d44 1071d4ac87
Author: Steve Purcell <steve@sanityinc.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #86 from ksqsf/master
    
    Update for Emacs 29
---
 symbol-overlay.el | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/symbol-overlay.el b/symbol-overlay.el
index c20f59355d..ff14ee5006 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -236,17 +236,20 @@ You can re-bind the commands to any keys you prefer.")
 If SYMBOL is non-nil, get the overlays that belong to it.
 DIR is an integer.
 If EXCLUDE is non-nil, get all overlays excluding those belong to SYMBOL."
-  (let ((lists (progn (overlay-recenter (point)) (overlay-lists)))
-        (func (if (> dir 0) 'cdr (if (< dir 0) 'car nil))))
-    (seq-filter
-     (lambda (ov)
-       (let ((value (overlay-get ov 'symbol)))
-         (and value
-              (or (not symbol)
-                  (if (string= value symbol) (not exclude)
-                    (and exclude (not (string= value ""))))))))
-     (if func (funcall func lists)
-       (append (car lists) (cdr lists))))))
+  (if (= dir 0)
+      (overlays-in (point-min) (point-max))
+    (let ((overlays (cond ((< dir 0) (overlays-in (point-min) (point)))
+                          ((> dir 0) (overlays-in (point) (point-max))))))
+      (seq-filter
+       (lambda (ov)
+         (let ((value (overlay-get ov 'symbol))
+               (end (overlay-end ov)))
+           (and value
+                (or (> dir 0) (< end (point)))
+                (or (not symbol)
+                    (if (string= value symbol) (not exclude)
+                      (and exclude (not (string= value ""))))))))
+       overlays))))
 
 (defun symbol-overlay-get-symbol (&optional noerror)
   "Get the symbol at point.



reply via email to

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