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

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

[nongnu] elpa/annotate 8f252d2892 025/372: clear-annotations does not cl


From: ELPA Syncer
Subject: [nongnu] elpa/annotate 8f252d2892 025/372: clear-annotations does not clear all overlays
Date: Fri, 4 Feb 2022 16:58:16 -0500 (EST)

branch: elpa/annotate
commit 8f252d2892fd0387ce626c6fedbae5feeaa59423
Author: Bastian Bechtold <bb@mo30211.hs-woe.de>
Commit: Bastian Bechtold <bb@mo30211.hs-woe.de>

    clear-annotations does not clear all overlays
    
    but only overlays that are annotations
---
 annotate.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/annotate.el b/annotate.el
index 01dbd4c90b..2f3eafac17 100644
--- a/annotate.el
+++ b/annotate.el
@@ -156,13 +156,18 @@
 (defun annotate-clear-annotations ()
   "Clear all current annotations."
   (interactive)
-  (let ((highlights
+  (let ((overlays
          (overlays-in 0 (buffer-size))))
+    ;; only remove annotations, not all overlays
+    (setq overlays (remove-if
+                    (lambda (ov)
+                      (eq nil (overlay-get ov 'annotation)))
+                    overlays))
     (save-excursion
-      (dolist (highlight highlights)
-        (goto-char (overlay-end highlight))
+      (dolist (ov overlays)
+        (goto-char (overlay-end ov))
         (move-end-of-line nil)
-        (delete-overlay highlight)
+        (delete-overlay ov)
         (remove-text-properties (point) (1+ (point)) '(display nil))))))
 
 (defun annotate-create-annotation (start end)



reply via email to

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