diff options
| author | Eli Zaretskii | 2002-03-29 13:31:19 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2002-03-29 13:31:19 +0000 |
| commit | 7b7a23f49bd7b7977cc13319c6c3683bbdb31ea7 (patch) | |
| tree | 7c341234bd97af64389b81344c9f896a133f41fd | |
| parent | 9ad79cb4276d2dd2cad8f34d9c2f2128461bac7a (diff) | |
| download | emacs-7b7a23f49bd7b7977cc13319c6c3683bbdb31ea7.tar.gz emacs-7b7a23f49bd7b7977cc13319c6c3683bbdb31ea7.zip | |
(save-buffer-state): Use make-symbol to bind `modified'.
| -rw-r--r-- | lisp/font-lock.el | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 308a3e2789c..5aa8f246b89 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -677,14 +677,20 @@ Major/minor modes can set this variable if they know which option applies.") | |||
| 677 | ;; We use this to preserve or protect things when modifying text properties. | 677 | ;; We use this to preserve or protect things when modifying text properties. |
| 678 | (defmacro save-buffer-state (varlist &rest body) | 678 | (defmacro save-buffer-state (varlist &rest body) |
| 679 | "Bind variables according to VARLIST and eval BODY restoring buffer state." | 679 | "Bind variables according to VARLIST and eval BODY restoring buffer state." |
| 680 | `(let* ,(append varlist | 680 | (let ((modified (make-symbol "modified"))) |
| 681 | '((modified (buffer-modified-p)) (buffer-undo-list t) | 681 | `(let* ,(append varlist |
| 682 | (inhibit-read-only t) (inhibit-point-motion-hooks t) | 682 | '((,modified (buffer-modified-p)) |
| 683 | (inhibit-modification-hooks t) | 683 | (buffer-undo-list t) |
| 684 | deactivate-mark buffer-file-name buffer-file-truename)) | 684 | (inhibit-read-only t) |
| 685 | ,@body | 685 | (inhibit-point-motion-hooks t) |
| 686 | (unless modified | 686 | (inhibit-modification-hooks t) |
| 687 | (restore-buffer-modified-p nil)))) | 687 | deactivate-mark |
| 688 | buffer-file-name | ||
| 689 | buffer-file-truename)) | ||
| 690 | (progn | ||
| 691 | ,@body) | ||
| 692 | (unless ,modified | ||
| 693 | (restore-buffer-modified-p nil))))) | ||
| 688 | (put 'save-buffer-state 'lisp-indent-function 1) | 694 | (put 'save-buffer-state 'lisp-indent-function 1) |
| 689 | (def-edebug-spec save-buffer-state let) | 695 | (def-edebug-spec save-buffer-state let) |
| 690 | ;; | 696 | ;; |