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

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

[elpa] 25/39: pabbrev-mode now sets inhibit-modification-hooks


From: Phillip Lord
Subject: [elpa] 25/39: pabbrev-mode now sets inhibit-modification-hooks
Date: Mon, 20 Oct 2014 08:22:41 +0000

phillord pushed a commit to branch externals/pabbrev
in repository elpa.

commit 33074a403d90dfe0028f9877ab97c887a62945b2
Author: Phillip Lord <address@hidden>
Date:   Thu Sep 11 14:54:49 2014 +0100

    pabbrev-mode now sets inhibit-modification-hooks
    
    This was motivated by a nasty interaction with linked-buffer
    but should be general.
---
 pabbrev.el |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/pabbrev.el b/pabbrev.el
index aa0e24e..6c1e9ce 100644
--- a/pabbrev.el
+++ b/pabbrev.el
@@ -469,10 +469,16 @@ I'm not telling you which version, I prefer."
 
 (defmacro pabbrev-save-buffer-modified-p (&rest body)
   "Eval BODY without affected buffer modification status"
-  `(let ((buffer-modified (buffer-modified-p))
-         (buffer-undo-list t))
-     ,@body
-     (set-buffer-modified-p buffer-modified)))
+  `(unwind-protect
+       (progn
+         ;; inhibit modification hooks to avoid nasty interaction
+         ;; with linked-buffer.el
+         (setq inhibit-modification-hooks t)
+         (let ((buffer-modified (buffer-modified-p))
+               (buffer-undo-list t))
+           ,@body
+           (set-buffer-modified-p buffer-modified)))
+     (setq inhibit-modification-hooks nil)))
 
 (defun pabbrev-get-usage-hash()
   "Returns the usage hash for this buffer."



reply via email to

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