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: Stefan Monnier
Subject: bug#20139: 25.0.50; eval-buffer ignores lexical-binding
Date: Wed, 18 Mar 2015 23:10:30 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> (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.

You can do M-: (setq lexical-binding t) from that buffer in order to
tell Emacs that the code in the buffer uses the lexical
version of the Elisp language, or better, you should put a "-*-
lexical-binding:t -*-" at the top of the file.


        Stefan





reply via email to

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