aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2009-09-11 03:39:28 +0000
committerGlenn Morris2009-09-11 03:39:28 +0000
commitae2fd0421f69f60b6d9cf9ce6a7dd530f841cd7f (patch)
treede97cc0187ae76597153c59539dd290dc9254def
parent4a6c9bec5a70ef99bf50bd26abbe9cfda1dfe8c4 (diff)
downloademacs-ae2fd0421f69f60b6d9cf9ce6a7dd530f841cd7f.tar.gz
emacs-ae2fd0421f69f60b6d9cf9ce6a7dd530f841cd7f.zip
(define-compiler-macro): Add a property that records where a macro was
defined.
-rw-r--r--lisp/emacs-lisp/cl-macs.el18
1 files changed, 16 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index f0ac3c562a1..1a8f1b18e6e 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2547,8 +2547,22 @@ and then returning foo."
2547 (cons (if (memq '&whole args) (delq '&whole args) 2547 (cons (if (memq '&whole args) (delq '&whole args)
2548 (cons '--cl-whole-arg-- args)) body)) 2548 (cons '--cl-whole-arg-- args)) body))
2549 (list 'or (list 'get (list 'quote func) '(quote byte-compile)) 2549 (list 'or (list 'get (list 'quote func) '(quote byte-compile))
2550 (list 'put (list 'quote func) '(quote byte-compile) 2550 (list 'progn
2551 '(quote cl-byte-compile-compiler-macro))))) 2551 (list 'put (list 'quote func) '(quote byte-compile)
2552 '(quote cl-byte-compile-compiler-macro))
2553 ;; This is so that describe-function can locate
2554 ;; the macro definition.
2555 (list 'let
2556 (list (list
2557 'file
2558 (or buffer-file-name
2559 (and (boundp 'byte-compile-current-file)
2560 (stringp byte-compile-current-file)
2561 byte-compile-current-file))))
2562 (list 'if 'file
2563 (list 'put (list 'quote func)
2564 '(quote compiler-macro-file)
2565 '(file-name-nondirectory file))))))))
2552 2566
2553;;;###autoload 2567;;;###autoload
2554(defun compiler-macroexpand (form) 2568(defun compiler-macroexpand (form)