all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: RE: 1) (elisp) `Advising Named Functions', 2) search filtering example
Date: Mon, 17 Oct 2016 11:41:56 -0700 (PDT)	[thread overview]
Message-ID: <e05d2762-9d76-4349-a222-d16e35c19197@default> (raw)
In-Reply-To: <jwvy41mamrw.fsf-monnier+gmane.emacs.devel@gnu.org>

> >> If you do this, then you will break the callers, which expect the
> >> value of this variable to be a single function.
> >
> > Tell that to the doc string for `add-hook', which has said what it
> > says in this regard for a very long time.
> 
> There is no contradiction between the two.  `add-hook's doc talks about
> the case where a "multiple-function hook" has a value which happens to
> be a single function (which is an acceptable value for those hooks, for
> historical reasons).

That's one interpretation.  There is no mention of the fact that
the hook it is talking about is necessarily a "multiple-function
hook" that happens to have a single function as value.

> Whereas we're here talking about "single-function hooks", i.e. variables
> which should only ever hold a single function and not a list of functions.
>
> You can use (add-hook <hook> <function>) on them, just like you can use
> (setq <hook> 5) on them.  That doesn't mean that it's correct to do so.

If you say so.  Who decided it is incorrect, and why?  As I noted,
previously it was not a no-no to use `add-hook' on such a hook,
and `add-hook' was specifically designed to handle the case of a
single function (whether "'multiple-function hook' that happens
to have a single function as value" or "single-function hook").

And unlike what you just said (you can but it is not correct to
do so - or is it just not necessarily correct?), the doc now says:

 "‘add-hook’ cannot be used to modify such a _single function
             ^^^^^^^^^^^^^^
  hook_, and you have to use ‘add-function’ instead (*note
                 ^^^^^^^^^^^
  Advising Functions::)."

I wonder who added that sentence. ;-)



  reply	other threads:[~2016-10-17 18:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17  5:25 1) (elisp) `Advising Named Functions', 2) search filtering example Drew Adams
2016-10-17 12:20 ` Noam Postavsky
2016-10-17 14:02   ` Drew Adams
2016-10-17 14:37     ` Noam Postavsky
2016-10-17 14:52       ` Stefan Monnier
2016-10-17 15:40         ` Drew Adams
2016-10-17 15:51           ` Stefan Monnier
2016-10-17 17:05             ` Drew Adams
2016-10-17 17:47               ` Stefan Monnier
2016-10-17 15:40       ` Drew Adams
2016-10-17 16:16         ` Noam Postavsky
2016-10-17 17:05           ` Drew Adams
2016-10-17 17:53             ` Stefan Monnier
2016-10-17 18:41               ` Drew Adams [this message]
2016-10-17 19:25                 ` Stefan Monnier
2016-10-18 19:47                   ` Richard Stallman
2016-10-19  6:15                     ` Eli Zaretskii
2016-10-19 20:00                       ` Richard Stallman
2016-10-19 20:18                         ` Stefan Monnier
2016-10-20  7:17                           ` Eli Zaretskii
2016-10-20  7:06                         ` Eli Zaretskii
2016-10-20 18:06                           ` Richard Stallman

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=e05d2762-9d76-4349-a222-d16e35c19197@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.