Subject: bug#56682: locked narrowing

From: Gregory Heytings <[email-masked]>
Date: Fri, 02 Dec 2022 00:24:00 +0000

>
> 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.  I think doing that would probably 
need two markers for each buffer, say beg_scan_marker and end_scan_marker. 
An initial scan would set beg_scan_marker to Z and end_scan_marker to BEG. 
Then each operation in insdel.c would move beg_scan_marker downwards (if 
the buffer position at which the operation takes place is before the 
current value of beg_scan_marker) and end_scan_marker upwards (if the 
buffer position at which the operation takes place is after the current 
value of beg_scan_marker).  Then we would only need to scan 
beg_scan_marker - some_constant .. end_scan_marker + some_constant again.

That being said, I'm not sure the added complexity, to avoid small delays 
when performing large editing operations in huge buffers, is worth the 
price.