emacs-devel
[Top][All Lists]
Advanced

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

Re: bug-reference-prog-mode slows down CC Mode's scrolling by ~7%


From: Stefan Monnier
Subject: Re: bug-reference-prog-mode slows down CC Mode's scrolling by ~7%
Date: Wed, 01 Sep 2021 16:59:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> However, this mechanism is rendered ineffective if a second function is
> add-hook'd onto jit-lock-functions.  Maybe this could be fixed, though
> it looks difficult.

I think we can "easily" handle this specific case if the
`bug-reference-prog-mode` function is added to the end of the hook
rather than to its beginning and use a patch along the lines of the
one below.

I don't know if it would make any difference to the 7% figure.


        Stefan


diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index a905936b6b9..14d09c979b9 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -390,7 +390,7 @@ jit-lock--run-functions
      'jit-lock-functions
      (lambda (fun)
        (pcase-let*
-           ((res (funcall fun beg end))
+           ((res (funcall fun (or tight-beg beg) (tight-end end)))
             (`(,this-beg . ,this-end)
              (if (eq (car-safe res) 'jit-lock-bounds)
                  (cdr res) (cons beg end))))




reply via email to

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