diff options
author | Yuan Fu <casouri@gmail.com> | 2022-11-21 12:54:35 -0800 |
---|---|---|
committer | Yuan Fu <casouri@gmail.com> | 2022-11-21 12:54:35 -0800 |
commit | aaeaa310f0391f5a5193e1a3d6e026986c4f2c0c (patch) | |
tree | 67765b95359bfc462e95606043e6b0cea3bb7c49 /lisp/font-lock.el | |
parent | b2ea38ab03e801859163b74a292aa75008e36541 (diff) | |
parent | f176a36f4629b56c9fd9e3fc15aebd04a168c4f5 (diff) | |
download | emacs-aaeaa310f0391f5a5193e1a3d6e026986c4f2c0c.tar.gz emacs-aaeaa310f0391f5a5193e1a3d6e026986c4f2c0c.tar.bz2 emacs-aaeaa310f0391f5a5193e1a3d6e026986c4f2c0c.zip |
Merge remote-tracking branch 'savannah/master' into feature/tree-sitter
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r-- | lisp/font-lock.el | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index bb895578630..bf9a179d6ae 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -641,16 +641,6 @@ Major/minor modes can set this variable if they know which option applies.") ;; Font Lock mode. -(eval-when-compile - ;; - ;; We use this to preserve or protect things when modifying text properties. - (defmacro save-buffer-state (&rest body) - "Bind variables according to VARLIST and eval BODY restoring buffer state." - (declare (indent 0) (debug t)) - `(let ((inhibit-point-motion-hooks t)) - (with-silent-modifications - ,@body)))) - (defvar-local font-lock-set-defaults nil) ; Whether we have set up defaults. (defun font-lock-specified-p (mode) @@ -1014,7 +1004,7 @@ This works by calling `font-lock-fontify-region-function'." (defun font-lock-unfontify-region (beg end) "Unfontify the text between BEG and END. This works by calling `font-lock-unfontify-region-function'." - (save-buffer-state + (with-silent-modifications (funcall font-lock-unfontify-region-function beg end))) (defvar font-lock-flush-function #'font-lock-after-change-function @@ -1164,7 +1154,7 @@ Put first the functions more likely to cause a change and cheaper to compute.") "Fontify the text between BEG and END. If LOUDLY is non-nil, print status messages while fontifying. This function is the default `font-lock-fontify-region-function'." - (save-buffer-state + (with-silent-modifications ;; Use the fontification syntax table, if any. (with-syntax-table (or font-lock-syntax-table (syntax-table)) ;; Extend the region to fontify so that it starts and ends at @@ -1223,8 +1213,7 @@ This function is the default `font-lock-unfontify-region-function'." ;; Called when any modification is made to buffer text. (defun font-lock-after-change-function (beg end &optional old-len) (save-excursion - (let ((inhibit-point-motion-hooks t) - (inhibit-quit t) + (let ((inhibit-quit t) (region (if font-lock-extend-after-change-region-function (funcall font-lock-extend-after-change-region-function beg end old-len)))) @@ -1319,8 +1308,7 @@ no ARG is given and `font-lock-mark-block-function' is nil. If `font-lock-mark-block-function' non-nil and no ARG is given, it is used to delimit the region to fontify." (interactive "P") - (let ((inhibit-point-motion-hooks t) - deactivate-mark) + (let (deactivate-mark) ;; Make sure we have the right `font-lock-keywords' etc. (if (not font-lock-mode) (font-lock-set-defaults)) (save-mark-and-excursion |