[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 e3f00f5: Clarify when to use advice-add vs add-fu
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] emacs-26 e3f00f5: Clarify when to use advice-add vs add-function |
Date: |
Tue, 22 May 2018 20:12:31 -0400 (EDT) |
branch: emacs-26
commit e3f00f5637a2790923a9c4c1d4b7dbf65027d8ce
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
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.
---
lisp/emacs-lisp/nadvice.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index e2e6825..e20cc65 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:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-26 e3f00f5: Clarify when to use advice-add vs add-function,
Noam Postavsky <=