projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b7ddd0f
)
Make with-buffer-unmodified-if-unchanged more efficient
author
Lars Ingebrigtsen
<larsi@gnus.org>
Tue, 3 May 2022 20:06:31 +0000
(22:06 +0200)
committer
Lars Ingebrigtsen
<larsi@gnus.org>
Tue, 3 May 2022 20:06:31 +0000
(22:06 +0200)
* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
Make more efficient.
lisp/emacs-lisp/subr-x.el
patch
|
blob
|
history
diff --git
a/lisp/emacs-lisp/subr-x.el
b/lisp/emacs-lisp/subr-x.el
index a416059df6262ba9330cd929b619bfa648fdc0ef..298d370cb2554a14ad32f149948924e1ee80be9a 100644
(file)
--- 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))))))))