unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
@ 2021-11-17 21:51 Drew Adams
  2021-11-18  8:27 ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Drew Adams @ 2021-11-17 21:51 UTC (permalink / raw)
  To: 51930

I'm trying to read (elisp) `Window Hooks', and I can't make heads or
tails of it.  Throughout this node there's mention of buffer-local
functions: "functions specified buffer-locally".

I have no idea what is meant by this.  I search the Elisp manual for
buffer-local, and I find zillions of matches that are about
buffer-local variables, of course.  And I find a couple of mentions
of buffer-local faces.  No mention, that I can find, of buffer-local
functions or "functions specified buffer-locally".  How to specify a
function buffer-locally?

A wild guess is that what you're trying to say has something to do
with using the LOCAL argument to `add-hook' or `remove-hook`.  But
if so, it's not clear what.

Please clean up this text so it's comprehensible by an average reader.
If buffer-local functions are indeed a thing now, please document what
they are, somewhere.

In GNU Emacs 27.2 (build 1, x86_64-w64-mingw32)
 of 2021-03-26 built on CIRROCUMULUS
Repository revision: deef5efafb70f4b171265b896505b92b6eef24e6
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.19042
System Description: Microsoft Windows 10 Pro (v10.0.2009.19042.1288)






^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2021-11-17 21:51 bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally? Drew Adams
@ 2021-11-18  8:27 ` Eli Zaretskii
  2021-11-18  9:42   ` Lars Ingebrigtsen
  2022-09-20 15:23   ` Lars Ingebrigtsen
  0 siblings, 2 replies; 18+ messages in thread
From: Eli Zaretskii @ 2021-11-18  8:27 UTC (permalink / raw)
  To: Drew Adams; +Cc: 51930

> From: Drew Adams <drew.adams@oracle.com>
> Date: Wed, 17 Nov 2021 21:51:29 +0000
> 
> I'm trying to read (elisp) `Window Hooks', and I can't make heads or
> tails of it.  Throughout this node there's mention of buffer-local
> functions: "functions specified buffer-locally".
> 
> I have no idea what is meant by this.  I search the Elisp manual for
> buffer-local, and I find zillions of matches that are about
> buffer-local variables, of course.  And I find a couple of mentions
> of buffer-local faces.  No mention, that I can find, of buffer-local
> functions or "functions specified buffer-locally".  How to specify a
> function buffer-locally?
> 
> A wild guess is that what you're trying to say has something to do
> with using the LOCAL argument to `add-hook' or `remove-hook`.  But
> if so, it's not clear what.
> 
> Please clean up this text so it's comprehensible by an average reader.
> If buffer-local functions are indeed a thing now, please document what
> they are, somewhere.

This is a very dramatic description of a problem ("can't make heads or
tails", "I have no idea what is meant", etc.), so I'm not sure whether
a simple cross-reference to the documentation of add-hook, which
explains what is meant by "buffer-local" in this case, will solve the
problem.  If it will, doing that is very easy.  In fact, I just did.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2021-11-18  8:27 ` Eli Zaretskii
@ 2021-11-18  9:42   ` Lars Ingebrigtsen
  2021-11-18 11:12     ` Eli Zaretskii
  2021-11-18 17:12     ` bug#51930: [External] : " Drew Adams
  2022-09-20 15:23   ` Lars Ingebrigtsen
  1 sibling, 2 replies; 18+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-18  9:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51930

Eli Zaretskii <eliz@gnu.org> writes:

> This is a very dramatic description of a problem ("can't make heads or
> tails", "I have no idea what is meant", etc.), so I'm not sure whether
> a simple cross-reference to the documentation of add-hook, which
> explains what is meant by "buffer-local" in this case, will solve the
> problem.  If it will, doing that is very easy.  In fact, I just did.

I think "Functions specified buffer-locally" is an unusual way to say
"the buffer-local value of window-buffer-change-functions" -- if indeed
that's what it's trying to say.  I think rewriting this in a less
passive voice would be a good idea:

---
Functions specified buffer-locally are called for any window showing
the corresponding buffer if that window has been created or assigned
that buffer since the last time window change functions were run.  In
this case the window is passed as argument.

Functions specified by the default value are called for a frame if at
least one window on that frame has been added, deleted or assigned
another buffer since the last time window change functions were run.
In this case the frame is passed as argument.
---


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2021-11-18  9:42   ` Lars Ingebrigtsen
@ 2021-11-18 11:12     ` Eli Zaretskii
  2021-11-18 17:12     ` bug#51930: [External] : " Drew Adams
  1 sibling, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2021-11-18 11:12 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 51930

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Drew Adams <drew.adams@oracle.com>,  51930@debbugs.gnu.org
> Date: Thu, 18 Nov 2021 10:42:13 +0100
> 
> I think "Functions specified buffer-locally" is an unusual way to say
> "the buffer-local value of window-buffer-change-functions" -- if indeed
> that's what it's trying to say.  I think rewriting this in a less
> passive voice would be a good idea:

I didn't touch that text, I added a general explanation before it.  I
didn't understand the report as being against the passive tense there.
Of course, everyone should feel free to improve and/or clarify the
text in the manual, regardless.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: [External] : Re: bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2021-11-18  9:42   ` Lars Ingebrigtsen
  2021-11-18 11:12     ` Eli Zaretskii
@ 2021-11-18 17:12     ` Drew Adams
  1 sibling, 0 replies; 18+ messages in thread
From: Drew Adams @ 2021-11-18 17:12 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Eli Zaretskii; +Cc: 51930@debbugs.gnu.org

> I think "Functions specified buffer-locally" is an unusual way to say
> "the buffer-local value of window-buffer-change-functions"

To put it mildly.  And it _doesn't_ say that,
at all.  There's no way to legitimately read
it as saying that.

> -- if indeed that's what it's trying to say.

Yes.  It's a question any reader will pose:
What is it trying to say?

> I think rewriting this in a less passive voice
> would be a good idea:
> 
> ---
> Functions specified buffer-locally

That has the same problem.  A reader asks,
What are they trying to say?  What does it
mean for a _function_ to be specified
buffer-locally?  Means nothing, so far.






^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2021-11-18  8:27 ` Eli Zaretskii
  2021-11-18  9:42   ` Lars Ingebrigtsen
@ 2022-09-20 15:23   ` Lars Ingebrigtsen
  2022-09-20 15:58     ` Drew Adams
  1 sibling, 1 reply; 18+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-20 15:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51930, Drew Adams

Eli Zaretskii <eliz@gnu.org> writes:

> This is a very dramatic description of a problem ("can't make heads or
> tails", "I have no idea what is meant", etc.), so I'm not sure whether
> a simple cross-reference to the documentation of add-hook, which
> explains what is meant by "buffer-local" in this case, will solve the
> problem.  If it will, doing that is very easy.  In fact, I just did.

I think the section is clear after that clarification, so I'm closing
this bug report.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-20 15:23   ` Lars Ingebrigtsen
@ 2022-09-20 15:58     ` Drew Adams
  2022-09-20 16:18       ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Drew Adams @ 2022-09-20 15:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Eli Zaretskii; +Cc: 51930@debbugs.gnu.org

> > This is a very dramatic description of a problem ("can't make heads or
> > tails", "I have no idea what is meant", etc.), so I'm not sure whether
> > a simple cross-reference to the documentation of add-hook, which
> > explains what is meant by "buffer-local" in this case, will solve the
> > problem.  If it will, doing that is very easy.  In fact, I just did.
> 
> I think the section is clear after that clarification, so I'm closing
> this bug report.

Nope, it's not clear.  The doc of `add-hook' does
not at all talk about buffer-local functions.  It
talks about buffer-local hooks and a buffer-local
hook list.  A buffer-local function is neither
defined nor described anywhere.

If what is meant is the use of the function on
a hook buffer-locally, then say that.  Don't imply
that there's such a thing, defined anywhere, as
a buffer-local function.  Or else define it
somewhere.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-20 15:58     ` Drew Adams
@ 2022-09-20 16:18       ` Eli Zaretskii
  2022-09-20 16:37         ` Drew Adams
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2022-09-20 16:18 UTC (permalink / raw)
  To: Drew Adams; +Cc: 51930, larsi

> From: Drew Adams <drew.adams@oracle.com>
> CC: "51930@debbugs.gnu.org" <51930@debbugs.gnu.org>
> Date: Tue, 20 Sep 2022 15:58:25 +0000
> 
> > I think the section is clear after that clarification, so I'm closing
> > this bug report.
> 
> Nope, it's not clear.  The doc of `add-hook' does
> not at all talk about buffer-local functions.

What are "buffer-local functions"?  I'm not aware of such a feature in
Emacs.  The documentation of add-hook doesn't mention any
"buffer-local functions".

The node "Windows Hooks" uses the phrase "Functions specified
buffer-locally", after it explains that hooks can have buffer-local or
global values.  I see no problem with that.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-20 16:18       ` Eli Zaretskii
@ 2022-09-20 16:37         ` Drew Adams
  2022-09-20 16:47           ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Drew Adams @ 2022-09-20 16:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51930@debbugs.gnu.org, larsi@gnus.org

> > > I think the section is clear after that clarification, so I'm closing
> > > this bug report.
> >
> > Nope, it's not clear.  The doc of `add-hook' does
> > not at all talk about buffer-local functions.
> 
> What are "buffer-local functions"?  I'm not aware of such a feature in
> Emacs.  The documentation of add-hook doesn't mention any
> "buffer-local functions".

We agree.  It's defined nowhere, AFAICT.  That's
the point of the bug report.

> The node "Windows Hooks" uses the phrase "Functions specified
> buffer-locally", after it explains that hooks can have buffer-local or
> global values.  I see no problem with that.

Is that the node you've linked to?  I thought
you linked to node `Setting Hooks', where
`add-hook' is covered.  (I think you said you
linked to where `add-hook' is covered?)

FWIW, I don't see any node "Windows Hooks" in
Emacs 28.1 or earlier.  Presumably that was
added later - 28.2 or 29?

However, does that node define/explain what
it _means_ for a _function_ to be "specified
buffer-locally"?  Is it just about functions
on hooks, and is it just that a "function
specified buffer-locally" _is_ (the use of)
a function on a buffer-local hook?

100% agreement that it's clear that _hooks_
(which are variables) can be buffer-local.

It sounds like maybe we're agreeing?





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-20 16:37         ` Drew Adams
@ 2022-09-20 16:47           ` Eli Zaretskii
  2022-09-20 18:11             ` Drew Adams
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2022-09-20 16:47 UTC (permalink / raw)
  To: Drew Adams; +Cc: 51930, larsi

> From: Drew Adams <drew.adams@oracle.com>
> CC: "larsi@gnus.org" <larsi@gnus.org>,
>         "51930@debbugs.gnu.org"
> 	<51930@debbugs.gnu.org>
> Date: Tue, 20 Sep 2022 16:37:15 +0000
> 
> > The node "Windows Hooks" uses the phrase "Functions specified
> > buffer-locally", after it explains that hooks can have buffer-local or
> > global values.  I see no problem with that.
> 
> Is that the node you've linked to?  I thought
> you linked to node `Setting Hooks', where
> `add-hook' is covered.  (I think you said you
> linked to where `add-hook' is covered?)

I looked in both.

> FWIW, I don't see any node "Windows Hooks" in

"Window Hooks", without "s".

> However, does that node define/explain what
> it _means_ for a _function_ to be "specified
> buffer-locally"?

I think it does, yes.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-20 16:47           ` Eli Zaretskii
@ 2022-09-20 18:11             ` Drew Adams
  2022-09-21  0:13               ` Phil Sainty
  0 siblings, 1 reply; 18+ messages in thread
From: Drew Adams @ 2022-09-20 18:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51930@debbugs.gnu.org, larsi@gnus.org

> > > The node "Windows Hooks" uses the phrase "Functions specified
> > > buffer-locally", after it explains that hooks can have buffer-local
> > > or global values.  I see no problem with that.
> >
> > Is that the node you've linked to?  I thought
> > you linked to node `Setting Hooks', where
> > `add-hook' is covered.  (I think you said you
> > linked to where `add-hook' is covered?)
> 
> I looked in both.
> 
> > FWIW, I don't see any node "Windows Hooks" in
> 
> "Window Hooks", without "s".

Thanks; I see that now (e.g. in Emacs 28.1).

BTW, there's a typo here; "of" should be "or":

 As any hook, these hooks can be set either globally
 of buffer-locally via the LOCAL argument of 'add-hook'
 ^^
 (*note Setting Hooks::) when the hook is installed.

> > However, does that node define/explain what
> > it _means_ for a _function_ to be "specified
> > buffer-locally"?
> 
> I think it does, yes.

I don't think so, FWIW.  One might _guess_ that it
means that, when used on a buffer-local hook the	
function _is_ a buffer-local function, IOW, guess
that that's the definition of a buffer-local
function.  But that's not said, AFAICT.  Please
consider adding such a definition.  (But should
such a general definition be in a node about only
_window_ hooks?)

FWIW, I see nothing (in 18.1) in node `Setting
Hooks' that mentions buffer-local functions.  All
I see mention of there is buffer-local hooks.
(That doesn't mean there shouldn't be a link to
that node -- the link is good.)





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-20 18:11             ` Drew Adams
@ 2022-09-21  0:13               ` Phil Sainty
  2022-09-21  1:27                 ` Drew Adams
  2022-09-21  2:36                 ` Eli Zaretskii
  0 siblings, 2 replies; 18+ messages in thread
From: Phil Sainty @ 2022-09-21  0:13 UTC (permalink / raw)
  To: Drew Adams; +Cc: 51930, Eli Zaretskii, larsi

The pattern I see in the manual is:

  -- Variable: HOOK-NAME
      This variable specifies functions ...

      Functions specified buffer-locally are called ...

      Functions specified by the default value are called ...


So there's a minor inconsistency in phrasing there.  How about we
change all of these like so:

      Functions specified by the buffer-local value are called ...

      Functions specified by the default value are called ...


Then it's consistent, and I think also resolves Drew's concern?


-Phil






^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-21  0:13               ` Phil Sainty
@ 2022-09-21  1:27                 ` Drew Adams
  2022-09-21  2:36                 ` Eli Zaretskii
  1 sibling, 0 replies; 18+ messages in thread
From: Drew Adams @ 2022-09-21  1:27 UTC (permalink / raw)
  To: Phil Sainty; +Cc: 51930@debbugs.gnu.org, Eli Zaretskii, larsi@gnus.org

>       Functions specified buffer-locally are called ...
>       Functions specified by the default value are called ...
> 
> So there's a minor inconsistency in phrasing there.  How about we
> change all of these like so:
> 
>       Functions specified by the buffer-local value are called ...
>       Functions specified by the default value are called ...
> 
> Then it's consistent, and I think also resolves Drew's concern?

Works for me.  Thx.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-21  0:13               ` Phil Sainty
  2022-09-21  1:27                 ` Drew Adams
@ 2022-09-21  2:36                 ` Eli Zaretskii
  2022-09-21  4:05                   ` Phil Sainty
  1 sibling, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2022-09-21  2:36 UTC (permalink / raw)
  To: Phil Sainty; +Cc: 51930, larsi, drew.adams

> Date: Wed, 21 Sep 2022 12:13:05 +1200
> From: Phil Sainty <psainty@orcon.net.nz>
> Cc: Eli Zaretskii <eliz@gnu.org>, 51930@debbugs.gnu.org, larsi@gnus.org
> 
> So there's a minor inconsistency in phrasing there.  How about we
> change all of these like so:
> 
>       Functions specified by the buffer-local value are called ...
> 
>       Functions specified by the default value are called ...

Double passive tense? no, thanks.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-21  2:36                 ` Eli Zaretskii
@ 2022-09-21  4:05                   ` Phil Sainty
  2022-09-21  6:21                     ` Stefan Kangas
  2022-09-22  3:11                     ` Richard Stallman
  0 siblings, 2 replies; 18+ messages in thread
From: Phil Sainty @ 2022-09-21  4:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51930, larsi, drew.adams

On 2022-09-21 14:36, Eli Zaretskii wrote:
>> From: Phil Sainty <psainty@orcon.net.nz>
>>       Functions specified by the buffer-local value are called ...
>>       Functions specified by the default value are called ...
> 
> Double passive tense? no, thanks.

Well one of those is what's already in the manual.

I personally disagree that the double passive tense is bad here,
but here's another alternative:


  -- Variable: window-buffer-change-functions

      A list of functions called during redisplay when window buffers
      have changed.  Each function takes a single argument.

      For the buffer-local value, each function is called for any window
      showing the corresponding buffer, if that window has been created
      or assigned that buffer since the last time window change functions
      were run.  In this case the window is passed as argument.

      For the default value, each function is called for a frame if at
      least one window on that frame has been added, deleted or assigned
      another buffer since the last time window change functions were
      run.  In this case the frame is passed as argument.






^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-21  4:05                   ` Phil Sainty
@ 2022-09-21  6:21                     ` Stefan Kangas
  2022-09-22  3:11                     ` Richard Stallman
  1 sibling, 0 replies; 18+ messages in thread
From: Stefan Kangas @ 2022-09-21  6:21 UTC (permalink / raw)
  To: Phil Sainty, Eli Zaretskii; +Cc: 51930, larsi, drew.adams

Phil Sainty <psainty@orcon.net.nz> writes:

> I personally disagree that the double passive tense is bad here,
> but here's another alternative:

That alternative is indeed less clear than what you had before.

    "Never use the passive where you can use the active."
                           ^^^^^^^^^^^^^
    —George Orwell, "Politics and the English Language," April 1946

Note the qualifier.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-21  4:05                   ` Phil Sainty
  2022-09-21  6:21                     ` Stefan Kangas
@ 2022-09-22  3:11                     ` Richard Stallman
  2022-09-22  6:54                       ` Eli Zaretskii
  1 sibling, 1 reply; 18+ messages in thread
From: Richard Stallman @ 2022-09-22  3:11 UTC (permalink / raw)
  To: Phil Sainty; +Cc: 51930, eliz, larsi, drew.adams

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

        > For the buffer-local value, each function is called for any window
        > showing the corresponding buffer, if that window has been created
        > or assigned that buffer since the last time window change functions
        > were run.  In this case the window is passed as argument.

        > For the default value, each function is called for a frame if at
        > least one window on that frame has been added, deleted or assigned
        > another buffer since the last time window change functions were
        > run.  In this case the frame is passed as argument.

It is always better to avoid the passive tense entirely, unless that
is difficult somehow.  I wanted to do this, to provide an example.
In the process I found a much worse problem: the text is not clear at all.
I don't understand the behavior it tries to document.

But I tried anyway, and documented what appears to be a bizarre use of
both the variable's default value and its current value, in different ways.

======================================================================
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.


-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
  2022-09-22  3:11                     ` Richard Stallman
@ 2022-09-22  6:54                       ` Eli Zaretskii
  0 siblings, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2022-09-22  6:54 UTC (permalink / raw)
  To: rms, martin rudalics; +Cc: psainty, 51930, larsi, drew.adams

> From: Richard Stallman <rms@gnu.org>
> Cc: eliz@gnu.org, 51930@debbugs.gnu.org, larsi@gnus.org,
> 	drew.adams@oracle.com
> 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.





^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-09-22  6:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 21:51 bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally? Drew Adams
2021-11-18  8:27 ` Eli Zaretskii
2021-11-18  9:42   ` Lars Ingebrigtsen
2021-11-18 11:12     ` Eli Zaretskii
2021-11-18 17:12     ` bug#51930: [External] : " Drew Adams
2022-09-20 15:23   ` Lars Ingebrigtsen
2022-09-20 15:58     ` Drew Adams
2022-09-20 16:18       ` Eli Zaretskii
2022-09-20 16:37         ` Drew Adams
2022-09-20 16:47           ` Eli Zaretskii
2022-09-20 18:11             ` Drew Adams
2022-09-21  0:13               ` Phil Sainty
2022-09-21  1:27                 ` Drew Adams
2022-09-21  2:36                 ` Eli Zaretskii
2022-09-21  4:05                   ` Phil Sainty
2022-09-21  6:21                     ` Stefan Kangas
2022-09-22  3:11                     ` Richard Stallman
2022-09-22  6:54                       ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).