summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-05-03 22:06:31 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-05-03 22:06:31 +0200
commit0a2f0e7f8c1ba54d160322c52865feef3e67d79c (patch)
tree52f9bcc2f57db855c389dd5ee56a2ae57c8425d5 /lisp/emacs-lisp
parentb7ddd0f2fd08c9dca0b75493e9e809bb5dab40d9 (diff)
downloademacs-0a2f0e7f8c1ba54d160322c52865feef3e67d79c.tar.gz
emacs-0a2f0e7f8c1ba54d160322c52865feef3e67d79c.tar.bz2
emacs-0a2f0e7f8c1ba54d160322c52865feef3e67d79c.zip
Make with-buffer-unmodified-if-unchanged more efficient
* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged): Make more efficient.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/subr-x.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index a416059df62..298d370cb25 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))))))))