emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 91a79eedf6: * lisp/jit-lock.el (jit-lock-function): Don't fontify


From: Stefan Monnier
Subject: master 91a79eedf6: * lisp/jit-lock.el (jit-lock-function): Don't fontify invisible text
Date: Tue, 6 Sep 2022 17:24:20 -0400 (EDT)

branch: master
commit 91a79eedf6c15af7868480a478d0a43acff75215
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/jit-lock.el (jit-lock-function): Don't fontify invisible text
    
    See bug#57447.  This can speed up fontification significantly when using
    things like outline-mode.
---
 lisp/jit-lock.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 9543253cf2..e28d6ec924 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -382,7 +382,11 @@ is active."
                   (or (not (eq jit-lock-defer-time 0))
                       (input-pending-p))))
        ;; No deferral.
-       (jit-lock-fontify-now start (+ start jit-lock-chunk-size))
+       (let* ((cend (min (point-max) (+ start jit-lock-chunk-size)))
+              (vend (next-single-property-change start 'invisible nil cend)))
+         ;; FIXME: Presumably if we're called it means `start' is
+         ;; not at EOB (nor invisible) and hence (> vend start).
+         (jit-lock-fontify-now start vend))
       ;; Record the buffer for later fontification.
       (unless (memq (current-buffer) jit-lock-defer-buffers)
        (push (current-buffer) jit-lock-defer-buffers))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]