summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/advice.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-08-03 05:20:51 +0000
committerMiles Bader <miles@gnu.org>2007-08-03 05:20:51 +0000
commite145a7fe95fb8f97407d125f94653ef95e42696d (patch)
tree4f83705aac9d1a4416dabcf774115f7cccb80bda /lisp/emacs-lisp/advice.el
parent2a4924ce174b1a2b032558f3036f1d95445c4936 (diff)
parent2f12b713116a4e15b4744fc78d5f0dbb57fcd1ca (diff)
downloademacs-e145a7fe95fb8f97407d125f94653ef95e42696d.tar.gz
emacs-e145a7fe95fb8f97407d125f94653ef95e42696d.tar.bz2
emacs-e145a7fe95fb8f97407d125f94653ef95e42696d.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 832-838) - Remove lisp/erc/erc-nicklist.el - Update some .arch-inventory files - Fix void function definition error in cus-edit.el - Update from CVS - Restore lisp/emacs-lisp/cl-loaddefs.el - Merge from emacs--rel--22 * emacs--rel--22 (patch 75-83) - Update from CVS - Remove lisp/erc/erc-nicklist.el - Update some .arch-inventory files - Indicate that emacs--devo--0--patch-834 does not need to be applied - Merge from gnus--rel--5.10 - Restore lisp/emacs-lisp/cl-loaddefs.el * gnus--rel--5.10 (patch 239-241) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-239
Diffstat (limited to 'lisp/emacs-lisp/advice.el')
-rw-r--r--lisp/emacs-lisp/advice.el12
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)))))