From: Drew Adams <drew.adams@oracle.com>
To: npostavs@users.sourceforge.net
Cc: 25581@debbugs.gnu.org
Subject: bug#25581: 25.1; Incorrect statement in (elisp) `Hooks'
Date: Wed, 1 Feb 2017 09:01:44 -0800 (PST) [thread overview]
Message-ID: <a956f679-33f8-481c-8d23-c9ad8caba7d1@default> (raw)
In-Reply-To: <87zii6por2.fsf@users.sourceforge.net>
> > The changes needed, I think, are (1) clarify that the requirement
> > of the value being a function applies only to `*-function' vars
> > and (2) be clear that there are multiple ways to change the value,
> > including plain old `setq' (as Mark O pointed out).
>
> Hmm, do we really need to explain that variables can be changed with
> setq (seems redundant)?
I think we do here. Especially since we tell users that you "have
to use" `add-function' to modify "such a single function hook".
A hook is (still) a variable. It's not super clear from the
doc that this is the case, IMO.
Because we want to be clear that you should not try to modify
the value using, e.g., `add-to-list' - so we recommend
`add-hook' or `add-function', we kind of fall into the trap
of not being clear that you can bind or set the value in the
usual ways. I do think it's worth pointing out that you can
do this.
> Though it might be useful to compare and contrast setq vs
> add-function (and maybe setq vs add-hook too?)
OK. But there's not a lot of compare-and-contrast to do, IMO.
All we need to say, I think, is that to change (replace) the
whole value you can use `setq' (or `set' or `setq-local...),
but to _modify_ the current value you should use `add-hook' or
`add-function' (and similar), depending on whether the var name
is `*-functions' or `*-hook', on the one hand (for `add-hook'),
or `*-function', on the other (for `add-function' etc).
> Also wondering if add-function needs a bit of "rebranding",
> since I see it keeps getting referred to as "advice" (i.e.,
> something to be avoided).
Good question! On the one hand, it does provide a replacement
for the old advice system. On the other hand, it is something
different and is quite general.
I don't have a good suggestion about the best branding for it,
but Stefan might have something to offer in this regard.
Whatever branding is chosen, it might entail rewriting some of
the manual.
Part of the question you pose is whether and how much it is
something to be avoided. Instead of just saying that or not
saying anything at all, it would be helpful if we let users
know about some of the consequences of using it, including
possible pitfalls or other things to be aware of. Again,
Stefan is likely the expert in this regard.
next prev parent reply other threads:[~2017-02-01 17:01 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 16:51 bug#25581: 25.1; Incorrect statement in (elisp) `Hooks' Drew Adams
2017-01-31 3:05 ` npostavs
2017-01-31 3:36 ` Mark Oteiza
2017-01-31 4:06 ` Drew Adams
2017-01-31 3:55 ` Drew Adams
2017-01-31 4:16 ` npostavs
2017-01-31 16:02 ` Drew Adams
2017-02-01 3:35 ` npostavs
2017-02-01 17:01 ` Drew Adams [this message]
2017-02-04 21:00 ` npostavs
2017-02-05 2:11 ` Drew Adams
2017-02-10 1:42 ` npostavs
2017-02-10 3:00 ` Drew Adams
2020-10-11 2:26 ` Lars Ingebrigtsen
2020-10-11 14:12 ` Drew Adams
2020-08-24 15:22 ` Lars Ingebrigtsen
2020-08-24 15:54 ` Stefan Kangas
2020-08-24 15:58 ` Lars Ingebrigtsen
2020-08-24 16:20 ` Drew Adams
2020-08-24 16:13 ` Drew Adams
2020-08-24 16:18 ` Drew Adams
2020-08-26 1:50 ` Richard Stallman
2020-08-26 18:27 ` Drew Adams
2020-08-24 16:01 ` Drew Adams
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=a956f679-33f8-481c-8d23-c9ad8caba7d1@default \
--to=drew.adams@oracle.com \
--cc=25581@debbugs.gnu.org \
--cc=npostavs@users.sourceforge.net \
/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).