Subject: bug#56682: locked narrowing

From: Stefan Monnier <[email-masked]>
Date: Wed, 17 Aug 2022 15:18:57 -0400

> Search in xdisp.c for "->base_line_number = 0", and you will see that
> we invalidate the cache when the narrowing changes or when other
> similar calamities happen.

OK, after another search I found (in `redisplay_window` and
`try_scrolling`) that we do:

	  if (!just_this_one_p
	      || current_buffer->clip_changed
	      || BEG_UNCHANGED < CHARPOS (startp))
	    /* Forget any recorded base line for line number display.  */
	    w->base_line_number = 0;

So IIUC `w->base_line_number` can be used if:

          w->base_line_number != 0
          && !current_buffer->clip_changed
          && BEG_UNCHANGED < w->base_line_pos

?

Why do we flush the cache when `just_this_one_p` is false?

        Stefan