Mercurial > emacs
comparison lisp/emacs-lisp/cl-macs.el @ 104929:41455e351c50
(define-compiler-macro): Add a property that records where a macro was
defined.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Fri, 11 Sep 2009 03:39:28 +0000 |
parents | aa3e957fcf20 |
children | 5d471f2d8534 |
comparison
equal
deleted
inserted
replaced
104928:5532cc06be89 | 104929:41455e351c50 |
---|---|
2545 (cl-transform-function-property | 2545 (cl-transform-function-property |
2546 func 'cl-compiler-macro | 2546 func 'cl-compiler-macro |
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) |
2555 (while | 2569 (while |
2556 (let ((func (car-safe form)) (handler nil)) | 2570 (let ((func (car-safe form)) (handler nil)) |