]> git.eshelyaron.com Git - emacs.git/commitdiff
Clarify when to use advice-add vs add-function
authorNoam Postavsky <npostavs@gmail.com>
Wed, 23 May 2018 00:08:01 +0000 (20:08 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Wed, 23 May 2018 00:08:01 +0000 (20:08 -0400)
* lisp/emacs-lisp/nadvice.el (add-function): Note in docstring that
advice-add should be used for named functions.

lisp/emacs-lisp/nadvice.el

index e2e682505754a0d6e0ef5213a847332a23c4bd7d..e20cc6570dbc1315f45823c653d06fdbaae15f8f 100644 (file)
@@ -288,6 +288,9 @@ a special meaning:
 If PLACE is a symbol, its `default-value' will be affected.
 Use (local \\='SYMBOL) if you want to apply FUNCTION to SYMBOL buffer-locally.
 Use (var VAR) if you want to apply FUNCTION to the (lexical) VAR.
+If you are trying to modify an existing named function rather
+than a function value, you probably want to use `advice-add'
+instead (see Info node `(elisp) Advising Named Functions').
 
 If one of FUNCTION or OLDFUN is interactive, then the resulting function
 is also interactive.  There are 3 cases: