Subject: bug#56682: feature/improved-locked-narrowing 9dee6df39c: Reworked locked narrowing.

From: Gregory Heytings <[email-masked]>
Date: Tue, 14 Feb 2023 10:30:13 +0000

Thanks for your changes.

A few other notes:

1. There are three places (indent.c:line_number_display_width, 
xdisp.c:display_count_lines_logically, fileio.c:write_region) where we 
currently use

record_unwind_protect (save_restriction_restore, save_restriction_save ());
Fwiden ();

2. In another place (process.c:Finternal_default_process_filter) we 
currently have:

/* If the output marker is outside of the visible region, save
    the restriction and widen.  */
if (! (BEGV <= PT && PT <= ZV))
   Fwiden ();

(without the "save the restriction" mentioned in the comment).

3. Also, in Ferase_buffer, we do Fwiden to "delete the entire contents of 
the current buffer".

These five places probably need to be adapted to handle labeled narrowings 
correctly.  If you agree with that, I'll write a patch to that effect.