Subject: bug#56682: locked narrowing

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

>> Because I can't find that code.
> What do you mean? it's in maybe_produce_line_number, obviously...

My intuition tells me it should be there, but I can't find it.

>> Apparently `maybe_produce_line_number`
>> just uses `w->base_line_number` whenever it's not 0, so apparently it's
>> set to 0 elsewhere.
> It's set to zero in several places in xdisp.c.

I can't seem to find even one of them related to the fact that the
buffer was modified.

When I test the code, I can see that it works correctly, but I can't see
in the code how the cache gets flushed/ignored/refreshed when the
buffer's contents is modified (e.g. by inserting a newline at BOB).

> But again, if you don't want to trust the cached values, just use
> display_count_lines starting from BOB.

That's already what nlinum does (via `line-number-at-pos`).

        Stefan