diff options
author | Benson Chu <bensonchu457@gmail.com> | 2022-12-31 19:45:43 -0600 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2023-01-08 13:43:19 +0200 |
commit | da96a1fd74189106c065e65002c7a4ac416fb5bb (patch) | |
tree | 96b1867c56d9e7b5e8c76009e43aff881eb60dac /lisp/font-lock.el | |
parent | b1aa720671efc37b85f222179d8ebc97d6d9baad (diff) | |
download | emacs-da96a1fd74189106c065e65002c7a4ac416fb5bb.tar.gz |
Add back renamed function 'font-lock-fontify-syntactically-region'
A more accurate replacement for font-lock-fontify-syntactically-region
would be a function that funcalls the
font-lock-fontify-syntactically-function variable. That way, callers
of the function can inherit new behavior, if the value of that variable
changes.
* lisp/font-lock.el (font-lock-fontify-syntactically-region):
Add function back, remove its obsolete alias.
Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r-- | lisp/font-lock.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 99df8fb9e06..1fa45379b9f 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1183,7 +1183,7 @@ This function is the default `font-lock-fontify-region-function'." (setq font-lock-syntactically-fontified end)) (font-lock-fontify-syntactic-keywords-region start end))) (unless font-lock-keywords-only - (funcall font-lock-fontify-syntactically-function beg end loudly)) + (font-lock-fontify-syntactically-region beg end loudly)) (font-lock-fontify-keywords-region beg end loudly) `(jit-lock-bounds ,beg . ,end)))) @@ -1531,6 +1531,12 @@ START should be at the beginning of a line." (defvar font-lock-comment-end-skip nil "If non-nil, Font Lock mode uses this instead of `comment-end-skip'.") +(defun font-lock-fontify-syntactically-region (beg end &optional loudly) + "Syntactically fontify the text between BEG and END. +If LOUDLY is non-nil, print status messages while fontifying. +This works by calling `font-lock-fontify-syntactically-function'." + (funcall font-lock-fontify-syntactically-function beg end loudly)) + (defun font-lock-default-fontify-syntactically (start end &optional loudly) "Put proper face on each string and comment between START and END. START should be at the beginning of a line." @@ -2369,7 +2375,6 @@ in which C preprocessor directives are used, e.g. `asm-mode' and (define-obsolete-function-alias 'font-lock-after-fontify-buffer #'ignore "29.1") (define-obsolete-function-alias 'font-lock-after-unfontify-buffer #'ignore "29.1") -(define-obsolete-function-alias 'font-lock-fontify-syntactically-region #'font-lock-default-fontify-syntactically "29.1") (provide 'font-lock) |