[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 1) (elisp) `Advising Named Functions', 2) search filtering example

From: Stefan Monnier
Subject: Re: 1) (elisp) `Advising Named Functions', 2) search filtering example
Date: Mon, 17 Oct 2016 13:53:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

>> 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).

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]