[Top][All Lists]

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

Re: Most of Elisp lacks lexical-binding: t

From: Stefan Monnier
Subject: Re: Most of Elisp lacks lexical-binding: t
Date: Mon, 04 Feb 2019 16:54:04 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> The question is, though, at what point does it become the default?

IIUC Eli is not in a hurry to see it become the default.

> One answer would be, support a "dynamic-binding" cookie line for
> Emacs-27 (which does nothing by default),

You can already use

    -*- lexical-binding:nil -*-

for that.

> incorporate your lexical-binding hack as an option.
> Then, go to lexical by default for Emacs-28.

This sounds rather optimistic to me.  We should at least start by giving
some warnings from the byte-compiler when compiling am Elisp file without
lexical-binding.  Maybe same thing when visiting an Elisp file.

There are also all the calls to `eval` which currently tend to mostly
still use dynamic binding (even in files labeled with
lexical-binding:t).  E.g. we could advertise `eval` as taking a minimum
of 2 args so the byte-compiler would start warning about calls that
don't explicitly request lexical or dynamic binding (and hence fall
back to the default dynamic binding).


reply via email to

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