Mercurial > emacs
comparison lisp/emacs-lisp/advice.el @ 37304:9ca19dfc32fb
(ad-make-advised-definition): Construct
advice for subrs differently.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 10 Apr 2001 15:17:09 +0000 |
parents | 543952c0704a |
children | d5f3a4fa3bc5 |
comparison
equal
deleted
inserted
replaced
37303:3a9c22d4a66f | 37304:9ca19dfc32fb |
---|---|
3087 ;; is no solution that interacts reasonably with the | 3087 ;; is no solution that interacts reasonably with the |
3088 ;; compiler, hence we just evaluate the original at macro | 3088 ;; compiler, hence we just evaluate the original at macro |
3089 ;; expansion time and return the result. The moral of that | 3089 ;; expansion time and return the result. The moral of that |
3090 ;; is that one should always deactivate advised special | 3090 ;; is that one should always deactivate advised special |
3091 ;; forms before one byte-compiles a file. | 3091 ;; forms before one byte-compiles a file. |
3092 (` ((, (if orig-macro-p | 3092 `(,(if orig-macro-p 'macroexpand 'eval) |
3093 'macroexpand | 3093 (cons ',origname |
3094 'eval)) | 3094 ,(ad-get-arguments advised-arglist 0)))) |
3095 (cons '(, origname) | |
3096 (, (ad-get-arguments advised-arglist 0)))))) | |
3097 ((and orig-subr-p | 3095 ((and orig-subr-p |
3098 orig-interactive-p | 3096 orig-interactive-p |
3097 (not interactive-form) | |
3099 (not advised-interactive-form)) | 3098 (not advised-interactive-form)) |
3100 ;; Check whether we were called interactively | 3099 ;; Check whether we were called interactively |
3101 ;; in order to do proper prompting: | 3100 ;; in order to do proper prompting: |
3102 (` (if (interactive-p) | 3101 `(if (interactive-p) |
3103 (call-interactively '(, origname)) | 3102 (call-interactively ',origname) |
3104 (, (ad-make-mapped-call | 3103 ,(ad-make-mapped-call orig-arglist |
3105 orig-arglist advised-arglist origname))))) | 3104 advised-arglist |
3105 origname))) | |
3106 ;; And now for normal functions and non-interactive subrs | 3106 ;; And now for normal functions and non-interactive subrs |
3107 ;; (or subrs whose interactive behavior was advised): | 3107 ;; (or subrs whose interactive behavior was advised): |
3108 (t (ad-make-mapped-call | 3108 (t (ad-make-mapped-call |
3109 advised-arglist orig-arglist origname))))) | 3109 advised-arglist orig-arglist origname))))) |
3110 | 3110 |