Subject: Re: bug#60333: [PATCH] whitespace: Update bob, eob markers in base and indirect buffers

From: Stefan Monnier <[email-masked]>
Date: Thu, 12 Jan 2023 11:15:00 -0500

>> On 12/28/22 09:51, Stefan Monnier wrote:
>> >>      When a buffer is changed, update `whitespace-bob-marker' and
>> >>      `whitespace-eob-marker' not just in the current buffer, but
>> >>      also in the base buffer and all of its indirect buffers (if
>> >>      any) (Bug#46982).
>> > 
>> > That doesn't sound right.  We should only update them in those indirect buffers
>> > which also use whitespace eob/bob markers.  It should be their individual
>> > responsibility to register hook functions to update their own markers.
>> 
>> The changelog was worded poorly; it does what you expect it to do. 
>> Attached is an updated patch with hopefully better wording; please let 
>> me know if it still needs improvement.
>
> Stefan, any further comments, or should this go in?

I think it shouldn't because it fixes a corner case of a much
wider problem.
E.g.:

    emacs -Q lisp/subr.el
    M-x make-indirect-buffer RET RET foo RET
    C-x 2 C-x b foo RET
    C-d C-d C-d

You should now see the first line of `subr.el` as:

    subr.el --- basic lisp subroutines for Emacs  -*- lexical-binding:t -*-

yet still highlighted as a comment because the buffer modification (and
hence the `after-change-functions`) was performed in the indirect buffer
which is in `fundamental-mode` and doesn't know it should mark the line
for re-fontification.

        Stefan