Subject: Re: bug#56682: locked narrowing

From: Stefan Monnier <[email-masked]>
Date: Thu, 01 Dec 2022 21:52:03 -0500

>> Maybe another option is to do the scan more lazily, keeping track more
>> precisely of what was scanned and/or needs rescanning.
> Thanks.  It's an option indeed, the problem here is how to keep track of
> what was scanned or needs rescanning.

My suggestion was to have as "steady state" that "everything is scanned
except for a region between BEG...END and no line was found to be larger
than MAX_SEEN_LINE_LENGTH".  So it requires keeping track of a BEG..END
(BEG can be an integer but END would likely be an (insert-before)
marker) plus an integer keeping track of MAX_SEEN_LINE_LENGTH.
Initially BEG is 1 and END is Z.

I can't think of a good way to detect when MAX_SEEN_LINE_LENGTH can be
made smaller, tho, so we might still need to rescan the whole buffer
every once in a blue moon.

        Stefan