[Top][All Lists]

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

bug#42267: Fontification takes a long time when an equation contains a d

From: Ikumi Keita
Subject: bug#42267: Fontification takes a long time when an equation contains a double prime
Date: Fri, 10 Jul 2020 16:53:39 +0900

Hi Najib and all,

>>>>> Najib Idrissi-Kaïtouni <najib.idrissi.kaitouni@gmail.com> writes:
> Yes, this is much, much better with this patch. I don't experience any
> noticeable slowdown anymore, whether in the test file or in my "real
> world" file. Thanks!

Thanks for confirmation. We'll fix the problem soon.

To AUCTeX developers:
I propose to install the attached fix. Any comments and suggestions are

The backgrounds of the problem are the following two:
1. When there is a closing quote (or double prime) '' without matching
   opening quote `` before it, current
   `font-latex-extend-region-backwards-quotation' ends up to decrease
   `font-lock-beg' by 5000 (=default value of
   `font-latex-multiline-boundary') and returns t.
2. Previously, font-latex-extend-region-backwards-* functions were
   stored in `font-latex-extend-region-functions' and called just once
   per fontify operation. However, now they are in
   `font-lock-extend-region-functions' and can be called repeatedly in
   `font-lock-default-fontify-region', until all of them return nil.

Therefore, when there is math expression like $f''(x)=x^{3}$, current
f-l-e-r-b-q repeatedly decreases `font-lock-beg' so that the font lock
region begins with BOB eventually. Thus every key stroke forces to
re-fontify all the region from top of the buffer. This is the reason of
the apparent slowdown in a large buffer.

I think the behavior of the above item 1 is a bug. When f-l-e-r-b-q
cannot find a matching opening quote, it should just give up to extend
the region anymore.

Ikumi Keita

Attachment: 0001-Don-t-extend-font-lock-region-too-much-bug-42267.patch
Description: candidate patch

reply via email to

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