Subject: Re: bug#56682: Fix the long lines font locking related slowdowns

From: Gregory Heytings <[email-masked]>
Date: Tue, 02 Aug 2022 15:09:08 +0000

>> It is necessary to add a locked narrowing around 
>> fontification-functions and pre/post-command-hook to ensure that Emacs 
>> remains responsive.
>
> Perhaps tweaking the value of syntax-wholeline-max could have a similar 
> enough effect?
>

It doesn't, alas.

>> Unless I misunderstand something, I think (and my tests seem to 
>> confirm) that that would be a workable solution, provided that the 
>> initial scan is reasonably fast, that is, at least six times faster 
>> than it is now.
>
> I'm afraid this approach is too blunt to be a solution.
>

Indeed, that's my conclusion too.  So until syntax-ppss (at least) is made 
an order of magnitude faster, the right thing to do is to use the forced 
narrowing method.