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

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 22 Jul 2022 16:44:37 +0200

Eli Zaretskii <[email-masked]> writes:

> Thanks.  This is indeed the immediate idea for that aspect, but I
> wonder what would developers of some major modes which widen the
> buffer say about this.  Some of them were very much against such
> restrictions in the past.

This reminds me of something I meant to mention -- Stefan M. once
proposed that there should be two kinds of narrowing (I think?).  The
first is the one that the user sets with `C-x n n', which says "the user
is only interested in this bit of the buffer", but programs are
"allowed" to remove that restriction when doing stuff (like font
locking).  The second type should be a strict one, where modes are not
allowed to widen the region.

Looking briefly at Gregory's new branch, it seems like that (sort of)
introduces this idea, but in a non-explicit way (i.e., by having an
inhibit-widen variable).

And, yes, some major mode authors were against this idea, but I think it
sounds like a sound idea.  And perhaps it'd make sense to implement it
like Stefan suggested, instead of `inhibit-widen'.

I've added Stefan to the CCs; perhaps he has some comments.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no