From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Mark Oteiza <mvoteiza@udel.edu>
Cc: John Wiegley <jwiegley@gmail.com>, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 5811404: Replace eldoc-documentation-function with a hook
Date: Sat, 09 Jul 2016 20:27:52 -0400 [thread overview]
Message-ID: <jwvpoqmgx14.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <20160707235954.GA6381@holos.localdomain> (Mark Oteiza's message of "Thu, 7 Jul 2016 19:59:54 -0400")
> […] advice should be reserved for the cases where you cannot modify
> a function’s behavior in any other way. If it is possible to do
> the same thing via a hook, that is preferable (see Hooks). […] In
> particular, Emacs’s own source files should not put advice on
> functions in Emacs. (There are currently a few exceptions to this
> convention, but we aim to correct them.)
A *-function variable is not an advice, but a hook.
It's a different kind of hook than those manipulated by add-hook (which
have names ending in -hook or -functions), but it's still a hook and
those have been used for many years in various parts of Emacs.
It just so happens that the operations that can manipulate those hooks
conveniently (add-function/remove-function) are provided in the same
file as the new advice-add, but that's only because it was convenient
and natural to implement advice-add on top of those new operations.
Stefan
next prev parent reply other threads:[~2016-07-10 0:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160707032857.31916.95107@vcs.savannah.gnu.org>
[not found] ` <20160707032857.E4A1422015C@vcs.savannah.gnu.org>
2016-07-07 9:36 ` [Emacs-diffs] master 5811404: Replace eldoc-documentation-function with a hook Stefan Monnier
2016-07-07 19:31 ` John Wiegley
2016-07-07 23:59 ` Mark Oteiza
2016-07-08 0:06 ` Dmitry Gutov
2016-07-10 0:27 ` Stefan Monnier [this message]
2016-07-14 13:36 ` Leo Liu
2016-07-15 0:16 ` Dmitry Gutov
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=jwvpoqmgx14.fsf-monnier+emacsdiffs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=jwiegley@gmail.com \
--cc=mvoteiza@udel.edu \
/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).