Mercurial > emacs
comparison lisp/emacs-lisp/advice.el @ 66398:df04170ba46b
(ad-make-advised-definition): Fix arg-order.
(defadvice): Add `doc-string' declaration.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 24 Oct 2005 16:14:34 +0000 |
parents | ed770a0a7846 |
children | 067115a6e738 7beb78bc1f8e |
comparison
equal
deleted
inserted
replaced
66397:768dad162d9e | 66398:df04170ba46b |
---|---|
3107 (not advised-interactive-form)) | 3107 (not advised-interactive-form)) |
3108 ;; Check whether we were called interactively | 3108 ;; Check whether we were called interactively |
3109 ;; in order to do proper prompting: | 3109 ;; in order to do proper prompting: |
3110 `(if (called-interactively-p) | 3110 `(if (called-interactively-p) |
3111 (call-interactively ',origname) | 3111 (call-interactively ',origname) |
3112 ,(ad-make-mapped-call orig-arglist | 3112 ,(ad-make-mapped-call advised-arglist |
3113 advised-arglist | 3113 orig-arglist |
3114 origname))) | 3114 origname))) |
3115 ;; And now for normal functions and non-interactive subrs | 3115 ;; And now for normal functions and non-interactive subrs |
3116 ;; (or subrs whose interactive behavior was advised): | 3116 ;; (or subrs whose interactive behavior was advised): |
3117 (t (ad-make-mapped-call | 3117 (t (ad-make-mapped-call |
3118 advised-arglist orig-arglist origname))))) | 3118 advised-arglist orig-arglist origname))))) |
3810 the advised function. `freeze' implies `activate' and `preactivate'. The | 3810 the advised function. `freeze' implies `activate' and `preactivate'. The |
3811 documentation of the advised function can be dumped onto the `DOC' file | 3811 documentation of the advised function can be dumped onto the `DOC' file |
3812 during preloading. | 3812 during preloading. |
3813 | 3813 |
3814 See Info node `(elisp)Advising Functions' for comprehensive documentation." | 3814 See Info node `(elisp)Advising Functions' for comprehensive documentation." |
3815 (declare (doc-string 3)) | |
3815 (if (not (ad-name-p function)) | 3816 (if (not (ad-name-p function)) |
3816 (error "defadvice: Invalid function name: %s" function)) | 3817 (error "defadvice: Invalid function name: %s" function)) |
3817 (let* ((class (car args)) | 3818 (let* ((class (car args)) |
3818 (name (if (not (ad-class-p class)) | 3819 (name (if (not (ad-class-p class)) |
3819 (error "defadvice: Invalid advice class: %s" class) | 3820 (error "defadvice: Invalid advice class: %s" class) |
3984 | 3985 |
3985 (ad-start-advice) | 3986 (ad-start-advice) |
3986 | 3987 |
3987 (provide 'advice) | 3988 (provide 'advice) |
3988 | 3989 |
3989 ;;; arch-tag: 29f8c9a1-8c88-471f-95d7-e28541c6b7c0 | 3990 ;; arch-tag: 29f8c9a1-8c88-471f-95d7-e28541c6b7c0 |
3990 ;;; advice.el ends here | 3991 ;;; advice.el ends here |