summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-04-15 22:10:16 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-04-15 22:10:16 -0400
commit36c0a3016e88cd380752758379a48d5e942601c4 (patch)
treeffdd588eda56c2cf7c8e97d62201d0fd9a1264b2 /lisp/emacs-lisp
parentefb3f01dbaff7162597297f75675d9880eb0a13a (diff)
downloademacs-36c0a3016e88cd380752758379a48d5e942601c4.tar.gz
emacs-36c0a3016e88cd380752758379a48d5e942601c4.tar.bz2
emacs-36c0a3016e88cd380752758379a48d5e942601c4.zip
* lisp/emacs-lisp/nadvice.el (add-function): Default simple vars to their
global bindings.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/nadvice.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index db8a0753466..6c09ddfb8cf 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -236,9 +236,8 @@ PROPS is an alist of additional properties, among which the following have
a special meaning:
- `name': a string or symbol. It can be used to refer to this piece of advice.
-PLACE cannot be a simple variable. Instead it should either be
-\(default-value 'VAR) or (local 'VAR) depending on whether FUNCTION
-should be applied to VAR buffer-locally or globally.
+If PLACE is a simple variable, only its global value will be affected.
+Use (local 'VAR) if you want to apply FUNCTION to VAR buffer-locally.
If one of FUNCTION or OLDFUN is interactive, then the resulting function
is also interactive. There are 3 cases:
@@ -251,7 +250,7 @@ is also interactive. There are 3 cases:
(cond ((eq 'local (car-safe place))
(setq place `(advice--buffer-local ,@(cdr place))))
((symbolp place)
- (error "Use (default-value '%S) or (local '%S)" place place)))
+ (setq place `(default-value ',place))))
`(advice--add-function ,where (gv-ref ,place) ,function ,props))
;;;###autoload