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

From: Stefan Monnier <[email-masked]>
Date: Tue, 02 Aug 2022 17:18:16 -0400

> It is necessary to add a locked narrowing around
> fontification-functions and pre/post-command-hook to ensure that Emacs
> remains responsive.

It's neither necessary (it's perfectly possible to do something quickly
that just needs to look at the first few lines of the buffer to decide
in which way to parse the nearby surrounding bytes, for example) nor
sufficient (it's easy to spend minutes wasting time running in circles
because of a bug, e.g. a bug triggered by the fact that the "unusual"
nature of the visible part of the buffer after an arbitrary narrowing).

It's very useful to get closer to this goal like your code does, but
let's keep things in perspective.

        Stefan