* lisp/emacs-lisp/advice.el (ad-make-advised-definition): Improve last fix.

This commit is contained in:
Stefan Monnier 2012-11-16 13:02:39 -05:00
parent 96e055075d
commit dd0c5bbb36
3 changed files with 12 additions and 1 deletions

View 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>

View 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))

View file

@ -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 ()