Subject: Re: bug#57447: 28.1.90; Can font-lock stop requesting fontification of invisible text?

From: Eli Zaretskii <[email-masked]>
Date: Sat, 27 Aug 2022 14:05:00 +0300

> From: Ihor Radchenko <[email-masked]>
> Cc: [email-masked]
> Date: Sat, 27 Aug 2022 18:37:36 +0800
> 
> > 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.
> 
> This may be an issue in some scenarios.
> I am wondering if something like font-lock-extend-region-functions may
> be utilized to shrink the fontification boundaries.

I don't know.  Maybe Stefan does.

> > 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.
> 
> If jit-lock-chunk-size must be an actual upper bound
>  "Jit-lock fontifies chunks of at most this many characters at a time."
> 
> then it does not always hold:

How did you collect the BEG and END values?  FWIW, I don't see
anything in jit-lock that enlarges the chunk size, except perhaps in
the stealth-fontification case, which you didn't activate?