From: Stefan Monnier Date: Sat, 28 Jul 2007 19:57:23 +0000 (+0000) Subject: (ad-interactive-form): Re-introduce. X-Git-Tag: emacs-pretest-23.0.90~11660 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=806bc6df0a6730551e9cc55aacc2dfa2b8dd13f1;p=emacs.git (ad-interactive-form): Re-introduce. (ad-body-forms, ad-advised-interactive-form): Revert this part of last change. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a9dc3eed6aa..eb4f2448c0e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,18 +1,23 @@ +2007-07-28 Stefan Monnier + + * emacs-lisp/advice.el (ad-interactive-form): Re-introduce. + (ad-body-forms, ad-advised-interactive-form): Revert this part of + last change. + 2007-07-28 Masatake YAMATO - * vc.el (vc-dired-mode): Added a menu for VC related - operation. Use backend name as the menu label Suggested by - David Kastrup. + * vc.el (vc-dired-mode): Add a menu for VC related operation. + Use backend name as the menu label Suggested by David Kastrup. 2007-07-28 Alan Mackenzie Fix problem with modes derived from CC Mode: - * progmodes/cc-mode.el (c-make-emacs-variables-local): move this + * progmodes/cc-mode.el (c-make-emacs-variables-local): Move this macro to cc-langs. - (c-init-language-vars-for): remove call to above macro. - * progmodes/cc-langs.el (c-make-emacs-variables-local): macro has + (c-init-language-vars-for): Remove call to above macro. + * progmodes/cc-langs.el (c-make-emacs-variables-local): Macro has been moved to here. - (c-make-init-lang-vars-fun): call c-make-emacs-variables-local. + (c-make-init-lang-vars-fun): Call c-make-emacs-variables-local. 2007-07-28 Eli Zaretskii 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)))))