diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2007-07-28 19:57:23 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2007-07-28 19:57:23 +0000 |
commit | 806bc6df0a6730551e9cc55aacc2dfa2b8dd13f1 (patch) | |
tree | 9ce623ff0edf845dc8049b2864e6c41f58af07fd /lisp/emacs-lisp | |
parent | 9d2aebf64918002fe3c1ad9ffcdbb69b0844159e (diff) | |
download | emacs-806bc6df0a6730551e9cc55aacc2dfa2b8dd13f1.tar.gz emacs-806bc6df0a6730551e9cc55aacc2dfa2b8dd13f1.tar.bz2 emacs-806bc6df0a6730551e9cc55aacc2dfa2b8dd13f1.zip |
(ad-interactive-form): Re-introduce.
(ad-body-forms, ad-advised-interactive-form): Revert this part of last change.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/advice.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index c6e80453d72..dbebf314798 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2586,13 +2586,21 @@ that property, or otherwise use `(&rest ad-subr-args)'." (natnump docstring)) docstring))) +(defun ad-interactive-form (definition) + "Return the interactive form of DEFINITION. +Like `interactive-form', but also works on pieces of advice." + (interactive-form + (if (ad-advice-p definition) + (ad-lambda-expression definition) + definition))) + (defun ad-body-forms (definition) "Return the list of body forms of DEFINITION." (cond ((ad-compiled-p definition) nil) ((consp definition) (nthcdr (+ (if (ad-docstring definition) 1 0) - (if (interactive-form definition) 1 0)) + (if (ad-interactive-form definition) 1 0)) (cdr (cdr (ad-lambda-expression definition))))))) ;; Matches the docstring of an advised definition. @@ -3024,7 +3032,7 @@ in any of these classes." (ad-get-enabled-advices function 'around) (ad-get-enabled-advices function 'after))) (let ((interactive-form - (interactive-form (ad-advice-definition advice)))) + (ad-interactive-form (ad-advice-definition advice)))) (if interactive-form ;; We found the first one, use it: (ad-do-return interactive-form))))) |