* buffer local part of a hook
@ 2016-03-07 12:52 Matthias Pfeifer
2016-03-07 12:54 ` Dmitry Gutov
0 siblings, 1 reply; 9+ messages in thread
From: Matthias Pfeifer @ 2016-03-07 12:52 UTC (permalink / raw)
To: help-gnu-emacs
Hi there,
i stumbled over this pieace of information in the "gnu emacs lisp reference
manual":
"The buffer-local part of this hook is run once for each window on the
affected frame, with the relevant window selected and its buffer current.
The global part is run once for the modified frame, with that frame
selected."
Question is: What is the buffer local / global part of a hook?
matthias.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: buffer local part of a hook
2016-03-07 12:52 buffer local part of a hook Matthias Pfeifer
@ 2016-03-07 12:54 ` Dmitry Gutov
2016-03-07 14:36 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Gutov @ 2016-03-07 12:54 UTC (permalink / raw)
To: Matthias Pfeifer, help-gnu-emacs
On 03/07/2016 02:52 PM, Matthias Pfeifer wrote:
> Question is: What is the buffer local / global part of a hook?
The buffer local and global values of the hook variable. Although that
should probably be considered an implementation detail.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: buffer local part of a hook
2016-03-07 12:54 ` Dmitry Gutov
@ 2016-03-07 14:36 ` Stefan Monnier
2016-03-07 15:41 ` Dmitry Gutov
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2016-03-07 14:36 UTC (permalink / raw)
To: help-gnu-emacs
>> Question is: What is the buffer local / global part of a hook?
> The buffer local and global values of the hook variable. Although that
> should probably be considered an implementation detail.
No, it's part of the exposed functionality, since add/remove-hook
specify explicitly with the `local' argument whether the specified
function should be added-to/removed-from the global or the local part.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: buffer local part of a hook
2016-03-07 14:36 ` Stefan Monnier
@ 2016-03-07 15:41 ` Dmitry Gutov
2016-03-07 17:31 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Gutov @ 2016-03-07 15:41 UTC (permalink / raw)
To: Stefan Monnier, help-gnu-emacs
On 03/07/2016 04:36 PM, Stefan Monnier wrote:
> No, it's part of the exposed functionality, since add/remove-hook
> specify explicitly with the `local' argument whether the specified
> function should be added-to/removed-from the global or the local part.
So we're fine with users changing the values of hooks directly, without
using add-hook/remove-hook?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: buffer local part of a hook
2016-03-07 15:41 ` Dmitry Gutov
@ 2016-03-07 17:31 ` Stefan Monnier
2016-03-08 13:08 ` Dmitry Gutov
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2016-03-07 17:31 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: help-gnu-emacs
>> No, it's part of the exposed functionality, since add/remove-hook
>> specify explicitly with the `local' argument whether the specified
>> function should be added-to/removed-from the global or the local part.
> So we're fine with users changing the values of hooks directly, without
> using add-hook/remove-hook?
No. But we're fine with exposing the concept that a hook as a "local
part" and a "global part".
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: buffer local part of a hook
2016-03-07 17:31 ` Stefan Monnier
@ 2016-03-08 13:08 ` Dmitry Gutov
2016-03-08 14:49 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Gutov @ 2016-03-08 13:08 UTC (permalink / raw)
To: Stefan Monnier; +Cc: help-gnu-emacs
On 03/07/2016 07:31 PM, Stefan Monnier wrote:
> No. But we're fine with exposing the concept that a hook as a "local
> part" and a "global part".
The original question, how I understood it, was how both parts are stored.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: buffer local part of a hook
2016-03-08 13:08 ` Dmitry Gutov
@ 2016-03-08 14:49 ` Stefan Monnier
2016-03-09 3:50 ` Dmitry Gutov
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2016-03-08 14:49 UTC (permalink / raw)
To: help-gnu-emacs
>> No. But we're fine with exposing the concept that a hook as a "local
>> part" and a "global part".
> The original question, how I understood it, was how both parts are stored.
I understood it to just asking for an explanation of those concepts are,
rather than how they're implemented. As for "exposing the
implementation", while I don't really like it we do already document it
in the Elisp manual:
-- Function: run-hooks &rest hookvars
[...]
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 ‘t’, the global hook
variable will be run as well.
-- Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: buffer local part of a hook
2016-03-08 14:49 ` Stefan Monnier
@ 2016-03-09 3:50 ` Dmitry Gutov
2016-03-09 4:01 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Gutov @ 2016-03-09 3:50 UTC (permalink / raw)
To: Stefan Monnier, help-gnu-emacs
On 03/08/2016 04:49 PM, Stefan Monnier wrote:
>> The original question, how I understood it, was how both parts are stored.
>
> I understood it to just asking for an explanation of those concepts are,
> rather than how they're implemented.
In that case, we still haven't explained them, I think (and I'm not sure
which words to use).
> As for "exposing the
> implementation", while I don't really like it we do already document it
> in the Elisp manual:
That's unfortunate. Has anything comparable, ever, been un-documented,
in the history of Emacs?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: buffer local part of a hook
2016-03-09 3:50 ` Dmitry Gutov
@ 2016-03-09 4:01 ` Stefan Monnier
0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2016-03-09 4:01 UTC (permalink / raw)
To: help-gnu-emacs
> In that case, we still haven't explained them, I think (and I'm not sure
> which words to use).
Could be.
>> As for "exposing the implementation", while I don't really like it we
>> do already document it in the Elisp manual:
> That's unfortunate. Has anything comparable, ever, been un-documented, in
> the history of Emacs?
No idea. But s long as we don't intend to change the implementation,
it's not really a problem,
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-03-09 4:01 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 12:52 buffer local part of a hook Matthias Pfeifer
2016-03-07 12:54 ` Dmitry Gutov
2016-03-07 14:36 ` Stefan Monnier
2016-03-07 15:41 ` Dmitry Gutov
2016-03-07 17:31 ` Stefan Monnier
2016-03-08 13:08 ` Dmitry Gutov
2016-03-08 14:49 ` Stefan Monnier
2016-03-09 3:50 ` Dmitry Gutov
2016-03-09 4:01 ` Stefan Monnier
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.