Skip to content

Commit f97628f

Browse files
committed
* lisp/emacs-lisp/syntax.el (syntax-propertize): ignore is like nil
(syntax-ppss-after-change-function): Mark it as obsolete. * lisp/font-lock.el (font-lock-apply-syntactic-highlight): Use syntax-ppss-flush-cache instead.
1 parent caa28f0 commit f97628f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lisp/emacs-lisp/syntax.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ END) suitable for `syntax-propertize-function'."
286286
(defun syntax-propertize (pos)
287287
"Ensure that syntax-table properties are set until POS (a buffer point)."
288288
(when (< syntax-propertize--done pos)
289-
(if (null syntax-propertize-function)
289+
(if (memq syntax-propertize-function '(nil ignore))
290290
(setq syntax-propertize--done (max (point-max) pos))
291291
;; (message "Needs to syntax-propertize from %s to %s"
292292
;; syntax-propertize--done pos)
@@ -404,7 +404,8 @@ These are valid when the buffer has no restriction.")
404404
(defvar-local syntax-ppss-narrow-start nil
405405
"Start position of the narrowing for `syntax-ppss-narrow'.")
406406

407-
(defalias 'syntax-ppss-after-change-function 'syntax-ppss-flush-cache)
407+
(define-obsolete-function-alias 'syntax-ppss-after-change-function
408+
#'syntax-ppss-flush-cache "27.1")
408409
(defun syntax-ppss-flush-cache (beg &rest ignored)
409410
"Flush the cache of `syntax-ppss' starting at position BEG."
410411
;; Set syntax-propertize to refontify anything past beg.

lisp/font-lock.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ see `font-lock-syntactic-keywords'."
15011501
;; Flush the syntax-cache. I believe this is not necessary for
15021502
;; font-lock's use of syntax-ppss, but I'm not 100% sure and it can
15031503
;; still be necessary for other users of syntax-ppss anyway.
1504-
(syntax-ppss-after-change-function start)
1504+
(syntax-ppss-flush-cache start)
15051505
(cond
15061506
((not override)
15071507
;; Cannot override existing fontification.

0 commit comments

Comments
 (0)