From 7f526211ba8dcdc6f950a5d9857e8b9247b3cfb1 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 8 Feb 2013 11:17:18 -0500 Subject: [PATCH] * 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 --- lisp/ChangeLog | 3 +++ lisp/emacs-lisp/byte-run.el | 10 +++++----- 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 + * 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) -- 2.39.5