* bug#6218: 23.2; Hooks doc needs improvement about running local & global @ 2010-05-18 20:52 Drew Adams 2010-05-19 1:57 ` Stefan Monnier 2011-07-13 21:43 ` Lars Magne Ingebrigtsen 0 siblings, 2 replies; 6+ messages in thread From: Drew Adams @ 2010-05-18 20:52 UTC (permalink / raw To: 6218 Maybe it's there and I just can't seem to find it, but it seems to me that the doc about running hooks should describe what happens when there are local and global versions of a hook - e.g. for `post-command-hook. The logical place for that explanation is node (elisp) Running Hooks. The only place I see it mentioned is in node Setting Hooks, where the LOCAL optional arg to `add-hook' is described. And the explanation there is vague and incomplete. For example: "If needed, this makes the hook buffer-local and adds `t' to the buffer-local value. The latter acts as a flag to run the hook functions in the default value as well as in the local value." What does "if needed" mean here? When is it needed? And what is the scope of that phrase? Normal English would suggest that it applies to the rest of the sentence, hence both to making the hook buffer-local and to adding `t' to the value. Under what circumstances will both the local and default values be run? Always (is `t' always present)? And just how is `t' added to the buffer-local value? At the end? There is in fact *NO* explanation of what it even means to have `t' as a member of a hook value. Node `Hooks' says clearly that the hook functions must be valid functions, which excludes `t'. I see no mention of `t' as a possible entry, and the entire discussion of hooks talks about invoking each of the entries as a function. In sum, this is as clear as mud. There should be a clear explanation of what happens when there are both local and global values. And it should be clear about just what happens if LOCAL is non-nil: is t added always, so that the default value is also processed? In GNU Emacs 23.2.1 (i386-mingw-nt5.1.2600) of 2010-05-08 on G41R2F1 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/xpm/include' ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#6218: 23.2; Hooks doc needs improvement about running local & global 2010-05-18 20:52 bug#6218: 23.2; Hooks doc needs improvement about running local & global Drew Adams @ 2010-05-19 1:57 ` Stefan Monnier 2011-07-13 21:33 ` Lars Magne Ingebrigtsen 2011-07-13 21:43 ` Lars Magne Ingebrigtsen 1 sibling, 1 reply; 6+ messages in thread From: Stefan Monnier @ 2010-05-19 1:57 UTC (permalink / raw To: Drew Adams; +Cc: 6218 > What does "if needed" mean here? When is it needed? And what is the Indeed it shouldn't be there: it's an implementation detail. Stefan ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#6218: 23.2; Hooks doc needs improvement about running local & global 2010-05-19 1:57 ` Stefan Monnier @ 2011-07-13 21:33 ` Lars Magne Ingebrigtsen 2011-07-13 22:12 ` Drew Adams 2011-07-13 22:15 ` Drew Adams 0 siblings, 2 replies; 6+ messages in thread From: Lars Magne Ingebrigtsen @ 2011-07-13 21:33 UTC (permalink / raw To: Stefan Monnier; +Cc: 6218 Stefan Monnier <monnier@iro.umontreal.ca> writes: >> What does "if needed" mean here? When is it needed? And what is the > > Indeed it shouldn't be there: it's an implementation detail. I've now removed the "if needed". -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#6218: 23.2; Hooks doc needs improvement about running local & global 2011-07-13 21:33 ` Lars Magne Ingebrigtsen @ 2011-07-13 22:12 ` Drew Adams 2011-07-13 22:15 ` Drew Adams 1 sibling, 0 replies; 6+ messages in thread From: Drew Adams @ 2011-07-13 22:12 UTC (permalink / raw To: 'Lars Magne Ingebrigtsen', 'Stefan Monnier'; +Cc: 6218 > >> What does "if needed" mean here? When is it needed? And > >> what is the > > > > Indeed it shouldn't be there: it's an implementation detail. > > I've now removed the "if needed". That was one little piece of the bug report. Why would you close this if that's the only part of it you fixed? ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#6218: 23.2; Hooks doc needs improvement about running local & global 2011-07-13 21:33 ` Lars Magne Ingebrigtsen 2011-07-13 22:12 ` Drew Adams @ 2011-07-13 22:15 ` Drew Adams 1 sibling, 0 replies; 6+ messages in thread From: Drew Adams @ 2011-07-13 22:15 UTC (permalink / raw To: 'Lars Magne Ingebrigtsen', 'Stefan Monnier'; +Cc: 6218 > That was one little piece of the bug report. > Why would you close this if that's the only part of it you fixed? OK, I just received your other message, where you speak about other parts of the fix. I'll close it again. Thanks. ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#6218: 23.2; Hooks doc needs improvement about running local & global 2010-05-18 20:52 bug#6218: 23.2; Hooks doc needs improvement about running local & global Drew Adams 2010-05-19 1:57 ` Stefan Monnier @ 2011-07-13 21:43 ` Lars Magne Ingebrigtsen 1 sibling, 0 replies; 6+ messages in thread From: Lars Magne Ingebrigtsen @ 2011-07-13 21:43 UTC (permalink / raw To: Drew Adams; +Cc: 6218 "Drew Adams" <drew.adams@oracle.com> writes: > Maybe it's there and I just can't seem to find it, but it seems to me > that the doc about running hooks should describe what happens when there > are local and global versions of a hook - e.g. for `post-command-hook. > > The logical place for that explanation is node (elisp) Running Hooks. I've now added some text about buffer-local hooks to that node, and to the Emacs manual. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-07-13 22:15 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-05-18 20:52 bug#6218: 23.2; Hooks doc needs improvement about running local & global Drew Adams 2010-05-19 1:57 ` Stefan Monnier 2011-07-13 21:33 ` Lars Magne Ingebrigtsen 2011-07-13 22:12 ` Drew Adams 2011-07-13 22:15 ` Drew Adams 2011-07-13 21:43 ` Lars Magne Ingebrigtsen
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.