all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: 6218@debbugs.gnu.org
Subject: bug#6218: 23.2; Hooks doc needs improvement about running local & global
Date: Tue, 18 May 2010 13:52:44 -0700	[thread overview]
Message-ID: <8ADE13315E8340F6907A4A4115DC857B@us.oracle.com> (raw)

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'
 






             reply	other threads:[~2010-05-18 20:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18 20:52 Drew Adams [this message]
2010-05-19  1:57 ` bug#6218: 23.2; Hooks doc needs improvement about running local & global 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

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=8ADE13315E8340F6907A4A4115DC857B@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=6218@debbugs.gnu.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.