diff options
author | Alan Mackenzie <acm@muc.de> | 2023-02-05 15:59:44 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2023-02-05 15:59:44 +0000 |
commit | 18c43bb9d6ced167aa315b4485b6283247e8b127 (patch) | |
tree | a3960777ffb76bfa741e85fe32aac59d123b453f /lisp/font-lock.el | |
parent | 94f291d1505a6eccc3d7503992265f9e15101c86 (diff) | |
download | emacs-18c43bb9d6ced167aa315b4485b6283247e8b127.tar.gz emacs-18c43bb9d6ced167aa315b4485b6283247e8b127.tar.bz2 emacs-18c43bb9d6ced167aa315b4485b6283247e8b127.zip |
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.
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r-- | lisp/font-lock.el | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 1fa45379b9f..9e944fe188a 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -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)) |