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

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

[nongnu] elpa/annotate 9fc6d7a839 311/372: - allowed deleting of annotat


From: ELPA Syncer
Subject: [nongnu] elpa/annotate 9fc6d7a839 311/372: - allowed deleting of annotations for info files.
Date: Fri, 4 Feb 2022 16:59:14 -0500 (EST)

branch: elpa/annotate
commit 9fc6d7a8397a1f88fbcaf70ef7c783460e15ed66
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>

    - allowed deleting of annotations for info files.
---
 annotate.el | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/annotate.el b/annotate.el
index 7774f5f019..396921c80e 100644
--- a/annotate.el
+++ b/annotate.el
@@ -1888,13 +1888,21 @@ See the variable: `annotate-use-echo-area'."
 This function is not part of the public API."
   (annotate-ensure-annotation (annotation)
     (save-excursion
-      (let ((chain (annotate-find-chain annotation)))
-        (dolist (single-element chain)
-          (goto-char (overlay-end single-element))
-          (move-end-of-line nil)
-          (annotate--remove-annotation-property (overlay-start single-element)
-                                                (overlay-end   single-element))
-          (delete-overlay single-element))))))
+      (with-current-buffer (current-buffer)
+        (let* ((chain         (annotate-find-chain annotation))
+               (filename      (annotate-actual-file-name))
+               (info-format-p (eq (annotate-guess-file-format filename)
+                                  :info)))
+          (dolist (single-element chain)
+            (goto-char (overlay-end single-element))
+            (move-end-of-line nil)
+            (when info-format-p
+              (read-only-mode -1))
+            (annotate--remove-annotation-property (overlay-start 
single-element)
+                                                  (overlay-end   
single-element))
+            (delete-overlay single-element)
+            (when info-format-p
+              (read-only-mode 1))))))))
 
 (defun annotate--delete-annotation-chain-ring (annotation-ring)
   "Delete overlay of `annotation-ring' from a buffer.



reply via email to

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