]> code.delx.au - gnu-emacs/commitdiff
* lisp/emacs-lisp/advice.el (ad-make-advised-definition): Improve last fix.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 16 Nov 2012 18:02:39 +0000 (13:02 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 16 Nov 2012 18:02:39 +0000 (13:02 -0500)
lisp/ChangeLog
lisp/emacs-lisp/advice.el
test/automated/advice-tests.el

index 7674881dd7bea4760f830e8bda24ee5194a8113b..41252ee85a98effe62468d4298cf05ecf6511e92 100644 (file)
@@ -1,5 +1,7 @@
 2012-11-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * emacs-lisp/advice.el (ad-make-advised-definition): Improve last fix.
+
        * emacs-lisp/cl-lib.el: Set more meaningful version number.
 
 2012-11-16  Martin Rudalics  <rudalics@gmx.at>
index 60c1a846a79cf5f36c3c836107f1f4efef4a0f6d..c2ebb3bbdc62663e73d0052cb89e5cf563a6597a 100644 (file)
@@ -2596,7 +2596,9 @@ in any of these classes."
           (ad-has-redefining-advice function))
       (let* ((origdef (ad-real-orig-definition function))
             ;; Construct the individual pieces that we need for assembly:
-            (orig-arglist (and origdef (ad-arglist origdef)))
+            (orig-arglist (let ((args (ad-arglist origdef)))
+                             ;; The arglist may still be unknown.
+                             (if (listp args) args '(&rest args))))
             (advised-arglist (or (ad-advised-arglist function)
                                  orig-arglist))
             (interactive-form (ad-advised-interactive-form function))
index 8f9bf54114cf2165fe6e15bc2e8e401a785fd254..80321f8f3f9e29c97468dea760eaa8e9570d5730 100644 (file)
      (sm-test5 6) 100.1)
     ((advice-remove 'sm-test5 (lambda (f y) (* (funcall f y) 5)))
      (sm-test5 6) 20.1)
+
+    ;; This used to signal an error (bug#12858).
+    ((autoload 'sm-test6 "foo")
+     (defadvice sm-test6 (around test activate)
+       ad-do-it)
+     t t)
+
     ))
 
 (ert-deftest advice-tests ()