GNU bug report logs -
#42267
Fontification takes a long time when an equation contains a double prime
Previous Next
Full log
Message #20 received at 42267 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Najib and all,
>>>>> Najib Idrissi-Kaïtouni <najib.idrissi.kaitouni <at> 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
welcome.
[Analysis]
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.
Regards,
Ikumi Keita
[0001-Don-t-extend-font-lock-region-too-much-bug-42267.patch (text/x-diff, attachment)]
This bug report was last modified 5 years and 6 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.