diff options
author | Noam Postavsky <npostavs@gmail.com> | 2018-05-22 20:08:01 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2018-05-22 20:08:01 -0400 |
commit | e3f00f5637a2790923a9c4c1d4b7dbf65027d8ce (patch) | |
tree | 9eccca565e2dd60bf890fd6c216032d49104d6df /lisp/emacs-lisp | |
parent | c0f3e6b56b2643730b724647df950631d73484bc (diff) | |
download | emacs-e3f00f5637a2790923a9c4c1d4b7dbf65027d8ce.tar.gz emacs-e3f00f5637a2790923a9c4c1d4b7dbf65027d8ce.tar.bz2 emacs-e3f00f5637a2790923a9c4c1d4b7dbf65027d8ce.zip |
Clarify when to use advice-add vs add-function
* lisp/emacs-lisp/nadvice.el (add-function): Note in docstring that
advice-add should be used for named functions.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/nadvice.el | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index e2e68250575..e20cc6570db 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -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: |