aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/font-lock.el22
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 ;;