unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: 51930@debbugs.gnu.org, eliz@gnu.org, larsi@gnus.org,
	drew.adams@oracle.com
Subject: bug#51930: 27.2; Buffer-local functions? Buffers specified buffer-locally?
Date: Wed, 21 Sep 2022 23:11:52 -0400	[thread overview]
Message-ID: <E1obCcy-0003K7-LR@fencepost.gnu.org> (raw)
In-Reply-To: <7110e0330e878c144a6364a8e6ad651c@webmail.orcon.net.nz> (message from Phil Sainty on Wed, 21 Sep 2022 16:05:10 +1200)

[[[ 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)







  parent reply	other threads:[~2022-09-22  3:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-09-22  6:54                       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1obCcy-0003K7-LR@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=51930@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=psainty@orcon.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).