Subject: bug#56393: Actually fix the long lines display bug

From: Ihor Radchenko <[email-masked]>
Date: Thu, 07 Jul 2022 08:28:07 +0800

Eli Zaretskii <[email-masked]> writes:

>> Again, I don't know (my understanding of the font-lock machinery is very 
>> limited).
>
> Your understanding of font-lock, or your understanding how it is
> invoked from the display code?
>
> I can help with the latter.  When Emacs is about to display some chunk
> of text, it checks whether the text has a non-nil 'fontified'
> property.  If it does, that chunk of text was already fontified, but
> if not, the display engine calls font-lock (via jit-lock.el) to
> fontify the next 1500 characters, and puts a non-nil 'fontified'
> property on those 1500 characters.  The result is face properties,
> which are then actually displayed.

Doesn't font-lock extend the region to be fontified to at least the full
current line? (see font-lock-extend-region-functions and
font-lock-extend-region-wholelines)

Best,
Ihor