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

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

[nongnu] elpa/annotate 8e8d5d125e 130/372: - fixed macro: "annotate-with


From: ELPA Syncer
Subject: [nongnu] elpa/annotate 8e8d5d125e 130/372: - fixed macro: "annotate-with-inhibit-modification-hooks".
Date: Fri, 4 Feb 2022 16:58:34 -0500 (EST)

branch: elpa/annotate
commit 8e8d5d125e0543a12a79eec8d3b20008330fe5f0
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>

    - fixed macro: "annotate-with-inhibit-modification-hooks".
---
 annotate.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/annotate.el b/annotate.el
index c34c364243..c4d770034d 100644
--- a/annotate.el
+++ b/annotate.el
@@ -195,11 +195,13 @@ annotation as defined in the database."
 
 (cl-defmacro annotate-with-inhibit-modification-hooks (&rest body)
   "Wrap 'body' in a block with modification-hooks inhibited."
-  `(unwind-protect
-       (progn
-         (setf inhibit-modification-hooks t)
-         ,@body)
-     (setf inhibit-modification-hooks t)))
+  (let ((old-mode (gensym)))
+    `(let ((,old-mode inhibit-modification-hooks))
+       (unwind-protect
+           (progn
+             (setf inhibit-modification-hooks t)
+             ,@body)
+         (setf inhibit-modification-hooks ,old-mode)))))
 
 (defun annotate-end-of-line-pos ()
  "Get the position of the end of line and rewind the point's
@@ -247,7 +249,7 @@ modified (for example a newline is inserted)."
 (defun annotate-initialize ()
   "Load annotations and set up save and display hooks."
   (annotate-load-annotations)
-  (add-hook 'after-save-hook 'annotate-save-annotations t t)
+  (add-hook 'after-save-hook                  'annotate-save-annotations t t)
   (add-hook 'window-configuration-change-hook 'font-lock-fontify-buffer  t t)
   (add-hook 'before-change-functions          'annotate-before-change-fn t t)
   (font-lock-add-keywords



reply via email to

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