Subject: bug#30078: 27.0.50; Use lexical-binding for M-:

From: Michael Heerdegen <[email-masked]>
Date: Fri, 12 Jan 2018 20:35:44 +0100

Stefan Monnier <[email-masked]> writes:

> I'm not sure we should try to encourage the user to think a piece of
> code can check the value of `lexical-binding` to know if it's being
> evaluated using lexical scoping rules.

I'm not sure, too.  But aren't *scratch* and *ielm* special?  These are
the current buffers when code is evaluated, but they are also some kind
of source-code buffer at the same time.  In source code file buffers,
M-x lexical-binding RET gives you the right answer about how the code in
this buffers is interpreted.

I think we should be careful - maybe new users are trying to learn Elisp
with the help of *ielm*.

With your patch, you get

ELISP> (let ((x 1)) (lambda () x))
(closure
 ((x . 1)
  t)
 nil x)

but if you put point after the input expression and hit C-x C-e you
suddenly get

(lambda nil x)

People who are actually learning Elisp will not make any sense out of
this, I think.

Michael.