* 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 7674881..41252ee 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 60c1a84..c2ebb3b 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 8f9bf54..80321f8 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 ()