[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 10:52:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> You're right. I did have the impression that add-function was
> considered to be okay, just like add-hook is.

It is.

> the important distinction is between the thing being added to, not the
> function used to do the adding.

That's right.  For `foo-predicate` and `foo-bar-function`, modifying the
variable is the raison d'ĂȘtre of that variable, so it's not harmful:
programmers know that by design this value may change.

On the contrary (symbol-function <foo>) is the value associated to
a function name and programmers usually expect that function to be
defined at somewhere in a file (in a single place) and the value is
expected (by the programmer and by other chunks of code which call it)
to be faithful to the file's code.


reply via email to

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