Subject: bug#57804: An infinite loop in a `fontify-region' function causes Emacs to hang indefinitely

From: Eli Zaretskii <[email-masked]>
Date: Fri, 16 Sep 2022 08:35:10 +0300

> Date: Thu, 15 Sep 2022 20:18:27 +0000
> From: Gregory Heytings <[email-masked]>
> cc: Eli Zaretskii <[email-masked]>, [email-masked], 
>     Lars Ingebrigtsen <[email-masked]>
> 
> > I see that manually evaluating `(setq-local long-line-threshold nil)' in 
> > a buffer where the optimization is already in effect (i.e. where 
> > `(long-line-optimizations-p)' evaluates to t) doesn't disable the 
> > optimization. Do you have a solution for that?
> 
> No, and that will not be supported.

I don't necessarily agree.  We didn't see the need for this yet, but
if we do find significant use cases where that could be important, we
will consider adding something, like perhaps re-evaluation of the
optimization flag under some circumstances.  For example, changing the
value of long-line-threshold could be one such trigger.

But for now we don't see a need for that, and prefer that Lisp
programs that run via fontification-functions will be adapted to this
new protocol.