summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/byte-run.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-11-03 17:48:30 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2014-11-03 17:48:30 -0500
commit50deba142a9f49270e43361e4b610bc67653ee3a (patch)
tree66347b7de786fd4bdb38ea0d3277e8a89e1d6d93 /lisp/emacs-lisp/byte-run.el
parent772a965c5f684c73e6ce6520ba49ef6b9a53651e (diff)
downloademacs-50deba142a9f49270e43361e4b610bc67653ee3a.tar.gz
emacs-50deba142a9f49270e43361e4b610bc67653ee3a.tar.bz2
emacs-50deba142a9f49270e43361e4b610bc67653ee3a.zip
* lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Fix compiler-macro
autoloading when specified as a lambda. * lisp/emacs-lisp/edebug.el (edebug-safe-prin1-to-string): Assume that edebug-prin1-to-string already handles circularity.
Diffstat (limited to 'lisp/emacs-lisp/byte-run.el')
-rw-r--r--lisp/emacs-lisp/byte-run.el21
1 files changed, 15 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 0edcf6197b4..97768fa7e1a 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -112,12 +112,21 @@ This may shift errors from run-time to compile-time.")
If `error-free', drop calls even if `byte-compile-delete-errors' is nil.")
(list 'compiler-macro
#'(lambda (f args compiler-function)
- `(eval-and-compile
- (function-put ',f 'compiler-macro
- ,(if (eq (car-safe compiler-function) 'lambda)
- `(lambda ,(append (cadr compiler-function) args)
- ,@(cddr compiler-function))
- `#',compiler-function)))))
+ (if (not (eq (car-safe compiler-function) 'lambda))
+ `(eval-and-compile
+ (function-put ',f 'compiler-macro #',compiler-function))
+ (let ((cfname (intern (concat (symbol-name f)
+ "--anon-compiler-macro"))))
+ `(progn
+ (eval-and-compile
+ (function-put ',f 'compiler-macro #',cfname))
+ ;; Don't autoload the compiler-macro itself, since the
+ ;; macroexpander will find this file via `f's autoload,
+ ;; if needed.
+ :autoload-end
+ (eval-and-compile
+ (defun ,cfname (,@(cadr compiler-function) ,@args)
+ ,@(cddr compiler-function))))))))
(list 'doc-string
#'(lambda (f _args pos)
(list 'function-put (list 'quote f)