1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

Ensure upper bound of font-lock region is less than point-max

This fixes bug #61298.  The new long-lines code may have narrowed a buffer
before font-lock-default-fontify-region gets called.

* lisp/font-lock.el (font-lock-default-fontify-region): Set `end' to point-max
if it is greater that it.
This commit is contained in:
Alan Mackenzie 2023-02-05 15:59:44 +00:00
parent 94f291d150
commit 18c43bb9d6

View File

@ -1154,6 +1154,8 @@ 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'."
(or (<= end (point-max))
(setq end (point-max)))
(with-silent-modifications
;; Use the fontification syntax table, if any.
(with-syntax-table (or font-lock-syntax-table (syntax-table))