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

From: Stefan Monnier <[email-masked]>
Date: Mon, 02 Apr 2018 20:12:43 -0400

> We need dynamic binding to run old programs which were written for it.
> We must keep it running forever for that reason.

In any case, I realized in the mean time that the issue is not so much
whether we'll keep this forever for backward compatibility but whether
we want to actively discourage its use.

> The 'e' command in the debugger needs to give access to the bindings
> of the code being debugged -- even if that code uses lexical binding.
> There are various ways to implement that.  How is it implemented now?

It pays attention to the frame in which point is located when you hit
`e`, then "unwinds" the bindings on the stack upto that frame
temporarily while evaluating the code you typed.

That same mechanism happens to work both for the dynamically bound
variables and for the lexically bound ones (because the lexical
environment is kept internally by the interpreter in a dynamically bound
variable).

        Stefan