summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-02-08 11:17:18 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2013-02-08 11:17:18 -0500
commit7f526211ba8dcdc6f950a5d9857e8b9247b3cfb1 (patch)
treee54a4072a9dbdb4f9503b18f1b85910fbace84a8 /lisp
parentc9586acc9719f5af71c61a24b7c5c40eb1b0905f (diff)
downloademacs-7f526211ba8dcdc6f950a5d9857e8b9247b3cfb1.tar.gz
* lisp/emacs-lisp/byte-run.el (eval-when-compile, eval-and-compile):
Eval body right away, now that we do eager macroexpansion. Fixes: debbugs:13605
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/emacs-lisp/byte-run.el10
2 files changed, 8 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 94ff282d58c..3dea3ed0380 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
+ * emacs-lisp/byte-run.el (eval-when-compile, eval-and-compile):
+ Eval body right away, now that we do eager macroexpansion (bug#13605).
+
* simple.el (end-of-buffer): Don't touch unrelated windows (bug#13466).
(fundamental-mode): Use run-mode-hooks.
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index b44ec68e2bf..48bcefaee1a 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -392,15 +392,15 @@ If you think you need this, you're probably making a mistake somewhere."
Thus, the result of the body appears to the compiler as a quoted constant.
In interpreted code, this is entirely equivalent to `progn'."
(declare (debug t) (indent 0))
- ;; Not necessary because we have it in b-c-initial-macro-environment
- ;; (list 'quote (eval (cons 'progn body)))
- (cons 'progn body))
+ (list 'quote (eval (cons 'progn body) lexical-binding)))
(defmacro eval-and-compile (&rest body)
"Like `progn', but evaluates the body at compile time and at load time."
(declare (debug t) (indent 0))
- ;; Remember, it's magic.
- (cons 'progn body))
+ ;; When the byte-compiler expands code, this macro is not used, so we're
+ ;; either about to run `body' (plain interpretation) or we're doing eager
+ ;; macroexpansion.
+ (list 'quote (eval (cons 'progn body) lexical-binding)))
(put 'with-no-warnings 'lisp-indent-function 0)
(defun with-no-warnings (&rest body)