emacs-diffs
[Top][All Lists]
Advanced

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

master 0a2f0e7f8c: Make with-buffer-unmodified-if-unchanged more efficie


From: Lars Ingebrigtsen
Subject: master 0a2f0e7f8c: Make with-buffer-unmodified-if-unchanged more efficient
Date: Tue, 3 May 2022 16:06:46 -0400 (EDT)

branch: master
commit 0a2f0e7f8c1ba54d160322c52865feef3e67d79c
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make with-buffer-unmodified-if-unchanged more efficient
    
    * lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
    Make more efficient.
---
 lisp/emacs-lisp/subr-x.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index a416059df6..298d370cb2 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -439,9 +439,9 @@ modification status:
          ;; If we didn't change anything in the buffer (and the buffer
          ;; was previously unmodified), then flip the modification status
          ;; back to "unchanged".
-         (when (buffer-live-p ,buffer)
+         (when (and ,hash (buffer-live-p ,buffer))
            (with-current-buffer ,buffer
-             (when (and ,hash (buffer-modified-p)
+             (when (and (buffer-modified-p)
                         (equal ,hash (buffer-hash)))
                (restore-buffer-modified-p nil))))))))
 



reply via email to

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