diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-10-07 12:25:09 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-10-07 12:25:09 -0400 |
commit | 4840b91e41329cd1221e6224142af9ae13fd7606 (patch) | |
tree | d5754fc6bad43232b04b88ac86e9e73bcbe7aa7c /lisp/font-lock.el | |
parent | d28581101adb967b32b2d1de93aba34ce69e15d2 (diff) | |
download | emacs-4840b91e41329cd1221e6224142af9ae13fd7606.tar.gz emacs-4840b91e41329cd1221e6224142af9ae13fd7606.tar.bz2 emacs-4840b91e41329cd1221e6224142af9ae13fd7606.zip |
Remove aliases of `with-silent-modifications`
There were many reinventions of `with-silent-modifications` (tho
many of them weren't reinventions but copy&paste of code from
font-lock, IIUC). Now that those don't even need to let-bind
`inhibit-point-motion-hooks` they're really just obsolete.
* lisp/font-lock.el (save-buffer-state): Delete macro.
(font-lock-unfontify-region, font-lock-default-fontify-region):
Use `with-silent-modifications` instead.
(font-lock-after-change-function, font-lock-fontify-block): Don't
let-bind `inhibit-point-motion-hooks`.
* lisp/htmlfontify.el (hfy-save-buffer-state): Delete macro.
(hfy-mark-trailing-whitespace, hfy-unmark-trailing-whitespace):
Use `with-silent-modifications` instead.
* lisp/jit-lock.el (with-buffer-prepared-for-jit-lock): Delete macro.
(jit-lock--debug-fontify, jit-lock-refontify, jit-lock-function)
(jit-lock-fontify-now, jit-lock-force-redisplay)
(jit-lock-deferred-fontify, jit-lock-context-fontify)
(jit-lock-after-change): Use `with-silent-modifications` instead.
* lisp/progmodes/antlr-mode.el (save-buffer-state-x): Delete macro.
(antlr-hide-actions): Use `with-silent-modifications` instead.
* lisp/progmodes/hideshow.el (hs-life-goes-on): Don't
let-bind `inhibit-point-motion-hooks`.
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 b6f4150964d..d132de3a322 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -633,16 +633,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) @@ -1002,7 +992,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 @@ -1152,7 +1142,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 @@ -1211,8 +1201,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)))) @@ -1307,8 +1296,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 |