From: Philipp Stephani <p.stephani2@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 48584@debbugs.gnu.org
Subject: bug#48584: 28.0.50; Incorrect hook ordering between local and global hooks with depth
Date: Tue, 25 May 2021 22:23:26 +0200 [thread overview]
Message-ID: <CAArVCkSZt2-hfHr=-eXCYmuzZYpUuoyTEiY+pBNDZytC9ZyRfA@mail.gmail.com> (raw)
In-Reply-To: <871r9uefvy.fsf@gnus.org>
Am Di., 25. Mai 2021 um 22:07 Uhr schrieb Lars Ingebrigtsen <larsi@gnus.org>:
>
> So... I don't see any obvious way to fix this, and perhaps we should
> just document that the order is undefined when you have both local and
> global hooks with the same name.
>
> Any opinions?
The order isn't undefined, and add-hook carefully distinguishes
between negative and nonnegative depths in this case. It's just that
the relative ordering of depths with the same sign but different
"localness" isn't considered/documented.
How about documenting something along those lines?
In "Running hooks", amend the paragraph
"If the hook variable is buffer-local, the buffer-local variable will
be used instead of the global variable. However, if the buffer-local
variable contains the element @code{t}, the global hook variable will
be run as well."
to say that the global hook is run at exactly the place where the "t" appears.
In "Setting hooks", amend the paragraph
"If @var{local} is non-@code{nil}, that says to add @var{function} to the
buffer-local hook list instead of to the global hook list. This makes
the hook buffer-local and adds @code{t} to the buffer-local value."
to specify where the "t" is added (IIUC it's appended if depth > 0 and
prepended otherwise).
next prev parent reply other threads:[~2021-05-25 20:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-22 11:21 bug#48584: 28.0.50; Incorrect hook ordering between local and global hooks with depth Philipp
2021-05-25 20:07 ` Lars Ingebrigtsen
2021-05-25 20:23 ` Philipp Stephani [this message]
2021-05-26 21:50 ` Lars Ingebrigtsen
2021-06-04 13:20 ` Philipp
2021-06-06 9:12 ` Lars Ingebrigtsen
2021-07-05 18:37 ` Philipp
2021-07-06 13:58 ` Lars Ingebrigtsen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAArVCkSZt2-hfHr=-eXCYmuzZYpUuoyTEiY+pBNDZytC9ZyRfA@mail.gmail.com' \
--to=p.stephani2@gmail.com \
--cc=48584@debbugs.gnu.org \
--cc=larsi@gnus.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.