Subject: Re: bug#20139: 25.0.50; eval-buffer ignores lexical-binding

From: Jorgen Schäfer <[email-masked]>
Date: Thu, 19 Mar 2015 08:33:52 +0100

On Thu, Mar 19, 2015 at 4:10 AM, Stefan Monnier
<[email-masked]> wrote:
>> (setq lexical-binding t)
>> (message "%s" (lambda () a))
>
> This is wrong.  The `setq' above is an expression evaluated at run-time,
> whereas what you want to say (that this code is written in the lexical
> version of the Elisp language) is something that needs to be known before
> evaluation proceeds.

I am sorry for the confusion; I added the `setq' form so it is easier
to C-x C-e it. The
bug I describe happens in a buffer with `lexical-binding' set, no
matter which way it
is set. I.e. the following snippet will message (lambda nil t) and
then (closure (t) nil t):

(with-temp-buffer
  (setq lexical-binding t)
  (insert "(message \"%S\" (lambda () t))")
  (eval-buffer)
  (eval-region (point-min) (point-max)))

Regards,
Jorgen