unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: rms@gnu.org
Cc: martin rudalics <rudalics@gmx.at>, eliz@gnu.org, emacs-devel@gnu.org
Subject: Re: window-buffer-change-functions
Date: Fri, 23 Sep 2022 23:13:37 +1200	[thread overview]
Message-ID: <a167097f9cac8584bed709a9a731f57c@webmail.orcon.net.nz> (raw)
In-Reply-To: <E1obZE9-0008Vr-N0@fencepost.gnu.org>

On 2022-09-23 15:19, Richard Stallman wrote:
> A variable is supposed to have one value at any given time.  It might
> be the default binding, or a something-local binding.  But regardless
> of why that binding is current at any time, its value is _the value_
> of the variable at that time.  The other bindings shouldn't affect
> what the variable stands for when they are not current.

Although the case in question is still unusual, it's worth noting that
most hooks might use both the buffer-local and default values when they
run, if both values are defined.  Quoting `add-hook':

     The optional fourth argument, LOCAL, if non-nil, says to modify
     the hook's buffer-local value rather than its global value.
     This makes the hook buffer-local, and it makes t a member of the
     buffer-local value.  That acts as a flag to run the hook
     functions of the global value as well as in the local value.

Therefore, in a majority of cases, running a hook with a buffer-local
value processes both the buffer-local list *and* the global list for
that variable.

As this behaviour is under the control of the buffer-local value,
it's still not the same as both values being used automatically for
two different purposes; but I just wanted to point out that there
has long been an established mechanism by which both the buffer-local
binding and the default binding of a hook variable are used together,
so the window hooks aren't unique in that regard.

The window hooks are different in other ways of course, but they are
reacting to window and frame changes rather than buffer changes, so
it probably wouldn't ever make sense for a buffer-local value to take
precedence over the default value for these hooks.  Splitting each of
them into two separate hooks wouldn't really gain anything in terms
of functionality then?


-Phil




  parent reply	other threads:[~2022-09-23 11:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <SJ0PR10MB54886AFA7B33CF1E43E2E013F39A9@SJ0PR10MB5488.namprd10.prod.outlook.com>
     [not found] ` <83o86hyild.fsf@gnu.org>
     [not found]   ` <877d1ycbom.fsf@gnus.org>
     [not found]     ` <SJ0PR10MB548895C6693206D88C719E60F34C9@SJ0PR10MB5488.namprd10.prod.outlook.com>
     [not found]       ` <835yhivx39.fsf@gnu.org>
     [not found]         ` <SJ0PR10MB5488AA81BBFCC4B4CE2D31B4F34C9@SJ0PR10MB5488.namprd10.prod.outlook.com>
     [not found]           ` <83v8piuh5k.fsf@gnu.org>
     [not found]             ` <SJ0PR10MB54887366A66613D1189EC466F34C9@SJ0PR10MB5488.namprd10.prod.outlook.com>
     [not found]               ` <2f85eda92184de27e10572e6b2320885@webmail.orcon.net.nz>
     [not found]                 ` <83pmfpv4fs.fsf@gnu.org>
     [not found]                   ` <7110e0330e878c144a6364a8e6ad651c@webmail.orcon.net.nz>
2022-09-21 13:59                     ` window-buffer-change-functions Richard Stallman
2022-09-21 16:22                       ` [External] : window-buffer-change-functions Drew Adams
2022-09-22  6:21                       ` window-buffer-change-functions Eli Zaretskii
2022-09-22  9:44                         ` window-buffer-change-functions martin rudalics
2022-09-23  3:19                           ` window-buffer-change-functions Richard Stallman
2022-09-23  6:12                             ` window-buffer-change-functions Eli Zaretskii
2022-09-24  2:43                               ` window-buffer-change-functions Richard Stallman
2022-09-23 11:13                             ` Phil Sainty [this message]
2022-09-24  2:43                               ` window-buffer-change-functions Richard Stallman

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=a167097f9cac8584bed709a9a731f57c@webmail.orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=rudalics@gmx.at \
    /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).