From: Stefan Monnier Date: Fri, 16 Nov 2012 18:02:39 +0000 (-0500) Subject: * lisp/emacs-lisp/advice.el (ad-make-advised-definition): Improve last fix. X-Git-Tag: emacs-24.3.90~173^2~18^2~92 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dd0c5bbb364c8a7f6c663c7bd93d048206b2e707;p=emacs.git * lisp/emacs-lisp/advice.el (ad-make-advised-definition): Improve last fix. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7674881dd7b..41252ee85a9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-11-16 Stefan Monnier + * 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 diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 60c1a846a79..c2ebb3bbdc6 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -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)) diff --git a/test/automated/advice-tests.el b/test/automated/advice-tests.el index 8f9bf54114c..80321f8f3f9 100644 --- a/test/automated/advice-tests.el +++ b/test/automated/advice-tests.el @@ -80,6 +80,13 @@ (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 ()