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

From: Stefan Monnier <[email-masked]>
Date: Sat, 13 Aug 2022 09:44:04 -0400

>> But the locked narrowing is applied based on the presence of long-lines
>> rather than based on the total size of the buffer.
> That's true, but the two are closely related: a buffer with very long
> lines tends also to be a large buffer.

They are related but I don't think it "closely"-enough to conflate the
two: e.g. many large buffers have no long lines (e.g. log files) and as
Dmitry mentions the thresholds are quite different (back-of-the-envelope
suggests a factor 100 or so).

> The solutions for stuff that depends on buffer size will indeed be
> different from solutions for stuff that depends on line size.
> However, font-lock currently depends on both,

Various parts of it depends on only one of the two, tho.

> and narrowing solves both, albeit in non-specific ways.

And I'm all for it as a blunt-but-effective "fallback", as long as it
can be selectively overridden from ELisp.

        Stefan