emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112301: * lisp/emacs-lisp/nadvice.el


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112301: * lisp/emacs-lisp/nadvice.el (add-function): Default simple vars to their
Date: Mon, 15 Apr 2013 22:10:16 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112301
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2013-04-15 22:10:16 -0400
message:
  * lisp/emacs-lisp/nadvice.el (add-function): Default simple vars to their
  global bindings.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/nadvice.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-04-16 00:51:46 +0000
+++ b/lisp/ChangeLog    2013-04-16 02:10:16 +0000
@@ -1,5 +1,8 @@
 2013-04-16  Stefan Monnier  <address@hidden>
 
+       * emacs-lisp/nadvice.el (add-function): Default simple vars to their
+       global bindings.
+
        * doc-view.el (doc-view-start-process): Handle url-handler directories.
 
 2013-04-15  Dmitry Gutov  <address@hidden>

=== modified file 'lisp/emacs-lisp/nadvice.el'
--- a/lisp/emacs-lisp/nadvice.el        2013-04-15 15:06:51 +0000
+++ b/lisp/emacs-lisp/nadvice.el        2013-04-16 02:10:16 +0000
@@ -236,9 +236,8 @@
 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 @@
   (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


reply via email to

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