branch: elpa/annotate commit 8f252d2892fd0387ce626c6fedbae5feeaa59423 Author: Bastian Bechtold <b...@mo30211.hs-woe.de> Commit: Bastian Bechtold <b...@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)