aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-11-09 00:14:25 -0500
committerStefan Monnier2014-11-09 00:14:25 -0500
commit57db3f3adc251b628c5aea7e513a66f9305fdd4b (patch)
tree01d3492c1fa689324330151d57ed06da9faca6c3
parentf86269414156e4d91458f2c70a0f022b92caa6ba (diff)
downloademacs-57db3f3adc251b628c5aea7e513a66f9305fdd4b.tar.gz
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.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/emacs-lisp/byte-run.el3
-rw-r--r--lisp/emacs-lisp/bytecomp.el54
-rw-r--r--lisp/emacs-lisp/cl-extra.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el7
-rw-r--r--lisp/emacs-lisp/macroexp.el4
6 files changed, 53 insertions, 31 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0aa7f04fecc..d2ce32586d9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12014-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
4 Don't call byte-compile-preprocess since the result will go through
5 cconv.
6 (byte-compile-output-docform): Handle uninterned `name' correctly.
7 * emacs-lisp/cl-macs.el (cl-define-compiler-macro): Use interned name
8 to circumvent byte-compiler bug.
9
10 * emacs-lisp/macroexp.el (macroexp--expand-all): Fix typo.
11 (macroexp--compiler-macro): Remove left-over debug code.
12
13 * emacs-lisp/cl-extra.el (cl-get): Silence compiler warning.
14
12014-11-08 Juri Linkov <juri@jurta.org> 152014-11-08 Juri Linkov <juri@jurta.org>
2 16
3 * simple.el (shell-command): Use buffer-name when output-buffer is 17 * simple.el (shell-command): Use buffer-name when output-buffer is
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 97768fa7e1a..1f8b04ec8f0 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -115,8 +115,7 @@ If `error-free', drop calls even if `byte-compile-delete-errors' is nil.")
115 (if (not (eq (car-safe compiler-function) 'lambda)) 115 (if (not (eq (car-safe compiler-function) 'lambda))
116 `(eval-and-compile 116 `(eval-and-compile
117 (function-put ',f 'compiler-macro #',compiler-function)) 117 (function-put ',f 'compiler-macro #',compiler-function))
118 (let ((cfname (intern (concat (symbol-name f) 118 (let ((cfname (intern (concat (symbol-name f) "--anon-cmacro"))))
119 "--anon-compiler-macro"))))
120 `(progn 119 `(progn
121 (eval-and-compile 120 (eval-and-compile
122 (function-put ',f 'compiler-macro #',cfname)) 121 (function-put ',f 'compiler-macro #',cfname))
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."
448 ;; (apply 'byte-compiler-options-handler forms))) 448 ;; (apply 'byte-compiler-options-handler forms)))
449 (declare-function . byte-compile-macroexpand-declare-function) 449 (declare-function . byte-compile-macroexpand-declare-function)
450 (eval-when-compile . ,(lambda (&rest body) 450 (eval-when-compile . ,(lambda (&rest body)
451 (let ((result nil)) 451 (let ((result nil))
452 (byte-compile-recurse-toplevel 452 (byte-compile-recurse-toplevel
453 (cons 'progn body) 453 (cons 'progn body)
454 (lambda (form) 454 (lambda (form)
455 (setf result 455 (setf result
456 (byte-compile-eval 456 (byte-compile-eval
457 (byte-compile-top-level 457 (byte-compile-top-level
458 (byte-compile-preprocess form)))))) 458 (byte-compile-preprocess form))))))
459 (list 'quote result)))) 459 (list 'quote result))))
460 (eval-and-compile . ,(lambda (&rest body) 460 (eval-and-compile . ,(lambda (&rest body)
461 (byte-compile-recurse-toplevel 461 (byte-compile-recurse-toplevel
462 (cons 'progn body) 462 (cons 'progn body)
463 (lambda (form) 463 (lambda (form)
464 ;; Don't compile here, since we don't know 464 ;; Don't compile here, since we don't know
465 ;; whether to compile as byte-compile-form 465 ;; whether to compile as byte-compile-form
466 ;; or byte-compile-file-form. 466 ;; or byte-compile-file-form.
467 (let ((expanded 467 (let ((expanded
468 (byte-compile-preprocess form))) 468 (macroexpand-all
469 (eval expanded lexical-binding) 469 form
470 expanded)))))) 470 macroexpand-all-environment)))
471 (eval expanded lexical-binding)
472 expanded))))))
471 "The default macro-environment passed to macroexpand by the compiler. 473 "The default macro-environment passed to macroexpand by the compiler.
472Placing a macro here will cause a macro to have different semantics when 474Placing a macro here will cause a macro to have different semantics when
473expanded by the compiler as when expanded by the interpreter.") 475expanded by the compiler as when expanded by the interpreter.")
@@ -2122,11 +2124,6 @@ list that represents a doc string reference.
2122 (eq (aref (nth (nth 1 info) form) 0) ?*)) 2124 (eq (aref (nth (nth 1 info) form) 0) ?*))
2123 (setq position (- position))))) 2125 (setq position (- position)))))
2124 2126
2125 (if preface
2126 (progn
2127 (insert preface)
2128 (prin1 name byte-compile--outbuffer)))
2129 (insert (car info))
2130 (let ((print-continuous-numbering t) 2127 (let ((print-continuous-numbering t)
2131 print-number-table 2128 print-number-table
2132 (index 0) 2129 (index 0)
@@ -2139,6 +2136,15 @@ list that represents a doc string reference.
2139 (print-gensym t) 2136 (print-gensym t)
2140 (print-circle ; Handle circular data structures. 2137 (print-circle ; Handle circular data structures.
2141 (not byte-compile-disable-print-circle))) 2138 (not byte-compile-disable-print-circle)))
2139 (if preface
2140 (progn
2141 ;; FIXME: We don't handle uninterned names correctly.
2142 ;; E.g. if cl-define-compiler-macro uses uninterned name we get:
2143 ;; (defalias '#1=#:foo--cmacro #[514 ...])
2144 ;; (put 'foo 'compiler-macro '#:foo--cmacro)
2145 (insert preface)
2146 (prin1 name byte-compile--outbuffer)))
2147 (insert (car info))
2142 (prin1 (car form) byte-compile--outbuffer) 2148 (prin1 (car form) byte-compile--outbuffer)
2143 (while (setq form (cdr form)) 2149 (while (setq form (cdr form))
2144 (setq index (1+ index)) 2150 (setq index (1+ index))
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index b8b7b2c170b..9ccfc8bfb93 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -588,7 +588,7 @@ If START or END is negative, it counts from the end."
588 "Return the value of SYMBOL's PROPNAME property, or DEFAULT if none. 588 "Return the value of SYMBOL's PROPNAME property, or DEFAULT if none.
589\n(fn SYMBOL PROPNAME &optional DEFAULT)" 589\n(fn SYMBOL PROPNAME &optional DEFAULT)"
590 (declare (compiler-macro cl--compiler-macro-get) 590 (declare (compiler-macro cl--compiler-macro-get)
591 (gv-setter (lambda (store) `(put ,sym ,tag ,store)))) 591 (gv-setter (lambda (store) (ignore def) `(put ,sym ,tag ,store))))
592 (or (get sym tag) 592 (or (get sym tag)
593 (and def 593 (and def
594 ;; Make sure `def' is really absent as opposed to set to nil. 594 ;; Make sure `def' is really absent as opposed to set to nil.
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index e76c0a411b7..c90cc040f84 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2767,7 +2767,12 @@ and then returning foo."
2767 (let ((p args) (res nil)) 2767 (let ((p args) (res nil))
2768 (while (consp p) (push (pop p) res)) 2768 (while (consp p) (push (pop p) res))
2769 (setq args (nconc (nreverse res) (and p (list '&rest p))))) 2769 (setq args (nconc (nreverse res) (and p (list '&rest p)))))
2770 (let ((fname (make-symbol (concat (symbol-name func) "--cmacro")))) 2770 ;; FIXME: The code in bytecomp mishandles top-level expressions that define
2771 ;; uninterned functions. E.g. it would generate code like:
2772 ;; (defalias '#1=#:foo--cmacro #[514 ...])
2773 ;; (put 'foo 'compiler-macro '#:foo--cmacro)
2774 ;; So we circumvent this by using an interned name.
2775 (let ((fname (intern (concat (symbol-name func) "--cmacro"))))
2771 `(eval-and-compile 2776 `(eval-and-compile
2772 ;; Name the compiler-macro function, so that `symbol-file' can find it. 2777 ;; Name the compiler-macro function, so that `symbol-file' can find it.
2773 (cl-defun ,fname ,(if (memq '&whole args) (delq '&whole args) 2778 (cl-defun ,fname ,(if (memq '&whole args) (delq '&whole args)
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index fc859e7af09..a1dc6fa05b2 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -97,8 +97,6 @@ each clause."
97 (condition-case err 97 (condition-case err
98 (apply handler form (cdr form)) 98 (apply handler form (cdr form))
99 (error 99 (error
100 (message "--------------------------------------------------")
101 (backtrace)
102 (message "Compiler-macro error for %S: %S" (car form) err) 100 (message "Compiler-macro error for %S: %S" (car form) err)
103 form))) 101 form)))
104 102
@@ -251,7 +249,7 @@ Assumes the caller has bound `macroexpand-all-environment'."
251 (format "%s quoted with ' rather than with #'" 249 (format "%s quoted with ' rather than with #'"
252 (list 'lambda (nth 1 f) '...)) 250 (list 'lambda (nth 1 f) '...))
253 (macroexp--expand-all `(,fun ,arg1 ,f . ,args)))) 251 (macroexp--expand-all `(,fun ,arg1 ,f . ,args))))
254 (`(funcall (,(or 'quote 'function) ,(and f (pred symbolp) . ,_)) . ,args) 252 (`(funcall (,(or 'quote 'function) ,(and f (pred symbolp)) . ,_) . ,args)
255 ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo' 253 ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo'
256 ;; has a compiler-macro. 254 ;; has a compiler-macro.
257 (macroexp--expand-all `(,f . ,args))) 255 (macroexp--expand-all `(,f . ,args)))