diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-11-09 00:14:25 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-11-09 00:14:25 -0500 |
commit | 57db3f3adc251b628c5aea7e513a66f9305fdd4b (patch) | |
tree | 01d3492c1fa689324330151d57ed06da9faca6c3 /lisp/emacs-lisp/bytecomp.el | |
parent | f86269414156e4d91458f2c70a0f022b92caa6ba (diff) | |
download | emacs-57db3f3adc251b628c5aea7e513a66f9305fdd4b.tar.gz emacs-57db3f3adc251b628c5aea7e513a66f9305fdd4b.tar.bz2 emacs-57db3f3adc251b628c5aea7e513a66f9305fdd4b.zip |
Fix bootstrap failure after last change to eval-and-compile.
* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
Don't call byte-compile-preprocess since the result will go through cconv.
(byte-compile-output-docform): Handle uninterned `name' correctly.
* lisp/emacs-lisp/cl-macs.el (cl-define-compiler-macro): Use interned name
to circumvent byte-compiler bug.
* lisp/emacs-lisp/cl-extra.el (cl-get): Silence compiler warning.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Fix typo.
(macroexp--compiler-macro): Remove left-over debug code.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index fdb8cc8f39d..d6163f27e1d 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -448,26 +448,28 @@ Return the compile-time value of FORM." ;; (apply 'byte-compiler-options-handler forms))) (declare-function . byte-compile-macroexpand-declare-function) (eval-when-compile . ,(lambda (&rest body) - (let ((result nil)) - (byte-compile-recurse-toplevel - (cons 'progn body) - (lambda (form) - (setf result - (byte-compile-eval - (byte-compile-top-level - (byte-compile-preprocess form)))))) - (list 'quote result)))) + (let ((result nil)) + (byte-compile-recurse-toplevel + (cons 'progn body) + (lambda (form) + (setf result + (byte-compile-eval + (byte-compile-top-level + (byte-compile-preprocess form)))))) + (list 'quote result)))) (eval-and-compile . ,(lambda (&rest body) - (byte-compile-recurse-toplevel - (cons 'progn body) - (lambda (form) - ;; Don't compile here, since we don't know - ;; whether to compile as byte-compile-form - ;; or byte-compile-file-form. - (let ((expanded - (byte-compile-preprocess form))) - (eval expanded lexical-binding) - expanded)))))) + (byte-compile-recurse-toplevel + (cons 'progn body) + (lambda (form) + ;; Don't compile here, since we don't know + ;; whether to compile as byte-compile-form + ;; or byte-compile-file-form. + (let ((expanded + (macroexpand-all + form + macroexpand-all-environment))) + (eval expanded lexical-binding) + expanded)))))) "The default macro-environment passed to macroexpand by the compiler. Placing a macro here will cause a macro to have different semantics when expanded by the compiler as when expanded by the interpreter.") @@ -2122,11 +2124,6 @@ list that represents a doc string reference. (eq (aref (nth (nth 1 info) form) 0) ?*)) (setq position (- position))))) - (if preface - (progn - (insert preface) - (prin1 name byte-compile--outbuffer))) - (insert (car info)) (let ((print-continuous-numbering t) print-number-table (index 0) @@ -2139,6 +2136,15 @@ list that represents a doc string reference. (print-gensym t) (print-circle ; Handle circular data structures. (not byte-compile-disable-print-circle))) + (if preface + (progn + ;; FIXME: We don't handle uninterned names correctly. + ;; E.g. if cl-define-compiler-macro uses uninterned name we get: + ;; (defalias '#1=#:foo--cmacro #[514 ...]) + ;; (put 'foo 'compiler-macro '#:foo--cmacro) + (insert preface) + (prin1 name byte-compile--outbuffer))) + (insert (car info)) (prin1 (car form) byte-compile--outbuffer) (while (setq form (cdr form)) (setq index (1+ index)) |