diff options
| author | Lars Ingebrigtsen | 2022-05-03 22:06:31 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-05-03 22:06:31 +0200 |
| commit | 0a2f0e7f8c1ba54d160322c52865feef3e67d79c (patch) | |
| tree | 52f9bcc2f57db855c389dd5ee56a2ae57c8425d5 | |
| parent | b7ddd0f2fd08c9dca0b75493e9e809bb5dab40d9 (diff) | |
| download | emacs-0a2f0e7f8c1ba54d160322c52865feef3e67d79c.tar.gz 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.
| -rw-r--r-- | lisp/emacs-lisp/subr-x.el | 4 |
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: | |||
| 439 | ;; If we didn't change anything in the buffer (and the buffer | 439 | ;; If we didn't change anything in the buffer (and the buffer |
| 440 | ;; was previously unmodified), then flip the modification status | 440 | ;; was previously unmodified), then flip the modification status |
| 441 | ;; back to "unchanged". | 441 | ;; back to "unchanged". |
| 442 | (when (buffer-live-p ,buffer) | 442 | (when (and ,hash (buffer-live-p ,buffer)) |
| 443 | (with-current-buffer ,buffer | 443 | (with-current-buffer ,buffer |
| 444 | (when (and ,hash (buffer-modified-p) | 444 | (when (and (buffer-modified-p) |
| 445 | (equal ,hash (buffer-hash))) | 445 | (equal ,hash (buffer-hash))) |
| 446 | (restore-buffer-modified-p nil)))))))) | 446 | (restore-buffer-modified-p nil)))))))) |
| 447 | 447 | ||