Subject: bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?

From: Eli Zaretskii <[email-masked]>
Date: Thu, 22 Sep 2022 09:54:44 +0300

> From: Richard Stallman <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked],
> 	[email-masked]
> Date: Wed, 21 Sep 2022 23:11:52 -0400
> 
> ======================================================================
> A list of functions for redisplay to call when the assignment of
> buffers to windows has changed.  Each function takes a single
> argument.
> 
> This variable is peculiar in that its default value has one meaning
> and its actual value (normally buffer-local) has a different meaning.
> Redisplay uses both of these values, each in a different way.
> 
> For the actual (buffer-local) value, redisplay calls each function
> once for each window, with the window as argument, if that window has
> been created or assigned that buffer since the last time the window
> change functions were called.
> 
> For the default value, redisplay calls each function once for each
> frame, with the frame as argument, if at least one window on that
> frame has been added, deleted or assigned another buffer since the
> last time window change functions were called.
> ======================================================================
> 
> However, looking at the doc string of the variable seems to describe
> a different behavior, more like this:
> 
> ======================================================================
> A list of functions for redisplay to call when the assignment of
> buffers to windows has changed.  Each function takes a single
> argument.
> 
> Redisplay examines the global value of this variable, and calls each
> function once for each frame, with the frame as argument, if at least
> one window on that frame has been added, deleted or made to display a
> different buffer since the last time window change functions were
> called.
> 
> Redisplay also checks a buffer-local value of this variable in each
> buffer that's currenly displayed in a window.  If there is one,
> redisplay calls each function listed there for each window that
> displays the buffer in question, with the window as argument,
> @emph{if} the window has been created, or made to display that buffer,
> since the last time the window change functions were called.
> ======================================================================
> 
> Is this correct?  I can't tell from the text available.

The manual is more correct: the code goes through windows and invokes
these functions for a window if its buffer has a non-nil buffer-local
value of the variable.