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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 31 Jul 2022 11:38:22 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: Gregory Heytings <[email-masked]>,  [email-masked],
>   [email-masked],  [email-masked]
> Date: Sun, 31 Jul 2022 10:22:40 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> It's the same problem than with fontification-functions.  We cannot know 
> >> what all these hooks that are installed by major and minor modes will do, 
> >> we cannot hope to fix them one by one, so it seems to me that with 
> >> long_line_optimizations_p, which is an unusual case anyway, it makes sense 
> >> to "punish" them all in the same way.
> >
> > It sounds...too drastic.  Lars, WDYT?
> 
> I agree with Gregory that it makes sense to disable (some) fontification
> stuff in long-line buffers.  It much more important to be able to view
> and edit these files than getting fontification details completely
> correct.

No disagreement here, but I was asking about the proposal to make the
locked narrowing in effect when any pre-command-hook or
post-command-hook runs.  These are usually unrelated to
fontifications, although Gregory found an example where it is.

IOW, the issue for which I wanted to hear your opinion was whether you
think it's okay to preclude, in a buffer with long lines, all
pre/post-command-hooks from accessing the entire buffer.