bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Jorgen Schäfer
Subject: bug#20139: 25.0.50; eval-buffer ignores lexical-binding
Date: Thu, 19 Mar 2015 15:52:11 +0100

On Thu, Mar 19, 2015 at 3:40 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> I am extracting Emacs Lisp code from a markdown file and evaluating
>> it. I can easily use eval-region instead of eval-buffer, so I have no
>> unsolved problem at the moment. Just figured I'd report this issue.
>
> The basic rule for me is "never (setq lexical-binding ...)".  Instead,
> either add the file-local magic marker and manipulate it as a whole
> buffer/file, or let-bind lexical-binding around the call to
> `eval-region', or pass the second arg to `eval'.

Let-binding `lexical-binding' does not affect `eval-buffer', either.

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

(lambda nil t)
(closure (t) nil t)

Regards,
Jorgen





reply via email to

[Prev in Thread] Current Thread [Next in Thread]