summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-macs.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2009-09-11 03:39:28 +0000
committerGlenn Morris <rgm@gnu.org>2009-09-11 03:39:28 +0000
commitae2fd0421f69f60b6d9cf9ce6a7dd530f841cd7f (patch)
treede97cc0187ae76597153c59539dd290dc9254def /lisp/emacs-lisp/cl-macs.el
parent4a6c9bec5a70ef99bf50bd26abbe9cfda1dfe8c4 (diff)
downloademacs-ae2fd0421f69f60b6d9cf9ce6a7dd530f841cd7f.tar.gz
emacs-ae2fd0421f69f60b6d9cf9ce6a7dd530f841cd7f.tar.bz2
emacs-ae2fd0421f69f60b6d9cf9ce6a7dd530f841cd7f.zip
(define-compiler-macro): Add a property that records where a macro was
defined.
Diffstat (limited to 'lisp/emacs-lisp/cl-macs.el')
-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."
(cons (if (memq '&whole args) (delq '&whole args)
(cons '--cl-whole-arg-- args)) body))
(list 'or (list 'get (list 'quote func) '(quote byte-compile))
- (list 'put (list 'quote func) '(quote byte-compile)
- '(quote cl-byte-compile-compiler-macro)))))
+ (list 'progn
+ (list 'put (list 'quote func) '(quote byte-compile)
+ '(quote cl-byte-compile-compiler-macro))
+ ;; This is so that describe-function can locate
+ ;; the macro definition.
+ (list 'let
+ (list (list
+ 'file
+ (or buffer-file-name
+ (and (boundp 'byte-compile-current-file)
+ (stringp byte-compile-current-file)
+ byte-compile-current-file))))
+ (list 'if 'file
+ (list 'put (list 'quote func)
+ '(quote compiler-macro-file)
+ '(file-name-nondirectory file))))))))
;;;###autoload
(defun compiler-macroexpand (form)