GNU bug report logs - #57447
28.1.90; Can font-lock stop requesting fontification of invisible text?

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> gmail.com>

Date: Sat, 27 Aug 2022 05:35:02 UTC

Severity: normal

Found in version 28.1.90

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 57447 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> gmail.com>
Cc: 57447 <at> debbugs.gnu.org
Subject: Re: bug#57447: 28.1.90; Can font-lock stop requesting fontification
 of invisible text?
Date: Sat, 27 Aug 2022 12:18:51 +0300
> From: Ihor Radchenko <yantar92 <at> gmail.com>
> Cc: 57447 <at> debbugs.gnu.org
> Date: Sat, 27 Aug 2022 15:45:19 +0800
> 
> I did expect some invisible text to be fontified, but did not expect 10x
> increase in the requested text size.

The increase depends on how much text is hidden in each chunk,
relative to jit-lock-chunk-size.  If you have a lot of small shunks of
hidden text interspersed with visible text, you could have all of the
invisible text fontified.

> > One way this could be improved is by making jit-lock-chunk-size
> > smaller.  This will make the probability of such "over-fontification"
> > lower.
> 
> I tried to reduce the chunk size and at appears to help. However, I am
> not sure if there are other side effects of reducing
> jit-lock-chunk-size.

If the size is smaller than the visible portion of the buffer, it will
cause repeated calls to fontification-functions, instead of just one
call.  If fontification-functions do their job in approximately linear
time, you shouldn't see any adverse effects, I think.  But if each
call to fontification-functions incurs some one-time overhead that is
relatively expensive, the result could be slower redisplay when the
window is scrolled a lot.

> The code producing the messages is in
> https://github.com/yantar92/org/blob/feature/org-font-lock-element/lisp/org-font-lock-core.el
> Search for org-font-lock-verbose in the code.
> 
> If you want to test it yourself, clone https://github.com/yantar92/org
> and use feature/org-font-lock-element branch with the file I provided,
> unfold the "Home" headline, and then unfold the "Ideas ..." headline.

I only want to test that if you see something that is inconsistent
with my description of how this stuff works, including the value of
jit-lock-chunk-size.




This bug report was last modified 2 years and 315 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.