[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/advice.el,v
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/advice.el,v |
Date: |
Sat, 28 Jul 2007 19:57:24 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Stefan Monnier <monnier> 07/07/28 19:57:24
Index: emacs-lisp/advice.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/advice.el,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- emacs-lisp/advice.el 26 Jul 2007 18:49:14 -0000 1.53
+++ emacs-lisp/advice.el 28 Jul 2007 19:57:22 -0000 1.54
@@ -2586,13 +2586,21 @@
(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 @@
(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)))))