emacs-devel
[Top][All Lists]
Advanced

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

Re: Declaring 'lexical-binding: nil' obsolete


From: Eduardo Ochs
Subject: Re: Declaring 'lexical-binding: nil' obsolete
Date: Sat, 25 Sep 2021 20:56:58 -0300

Let me double-check... so is it enough to add a

  -*- lexical-binding: nil; -*-

to the end of the first line of each of our ".el" files?

All the files of eev use dynamic binding... and they are also marked
with "no-byte-compile: t" for reasons explained here,

  http://angg.twu.net/eev-intros/find-eev-install-intro.html#7.1
  (find-eev-install-intro "7.1. Byte-compilation")

So I don't usually see the byte-compiler warnings...

  [[]],
    Eduardo Ochs
    http://angg.twu.net/#eev

On Sat, 25 Sept 2021 at 19:49, Stefan Kangas <stefan@marxist.se> wrote:
>
> Hi all,
>
> Lexical binding has been with us since Emacs 24.1, released on
> 2012-06-10, almost ten years ago.  In Emacs 28.1, we will have no files
> that do not use lexical-binding.[1]
>
> I think it is time to formally declare the "lexical-binding:nil" dialect
> of Emacs Lisp obsolete.
>
> I have been thinking about what a roadmap could look like, and I would
> like to propose a roadmap, best explained by this NEWS entry:
>
>     ** 'lexical-binding: nil' is now obsolete.
>     The old 'lexical-binding:nil' dialect of Emacs Lisp is now obsolete.
>     Third-party code will need to be changed to support
>     'lexical-binding:t' to run properly on Emacs in the future.
>
>     We expect that this transition will be very smooth in most cases.
>     See the Info node "(elisp) Converting to Lexical Binding" in
>     the Emacs Lisp reference manual for some advice.
>
>     For now, the most visible effect of this is that there is a warning
>     when byte-compiling a file that does not specify lexical-binding to
>     either nil or t.  This is intended as a stop-gap, and we will
>     eventually warn if this variable is nil.
>
>     The plan for phasing out 'lexical-binding:nil' is as follows:
>
>     Emacs 28.1 - The byte-compiler warns if there is no 'lexical-binding'
>                  cookie.
>
>     Emacs 30.1 - The byte-compiler warns if there is no 'lexical-binding'
>                  cookie, or if the cookie is 'lexical-binding:nil'.
>
>     Emacs 32.1 - The warnings remain as before, and 'lexical-binding:t' is
>                  the default.
>
> The version numbers in this plan could be adjusted, but the ones I
> propose should already give us most of the next decade before we
> actually flip the switch.  In any case, whatever we decide now could
> easily be adjusted in the future if needed.
>
> Please see the attached patch for an idea of what this obsoletion might
> amount to in terms of code.  It basically adds the following
> byte-compiler warning:
>
>     In toplevel form:
>     lisp/foobar.el: Warning: First line should contain either
>         "-*-lexical-binding:t-*-" or "-*-lexical-binding:nil-*-".
>
> Footnotes:
> [1] org-agenda.el still has no cookie, but it will once the latest
>      version of Org-mode is merged into our tree.



reply via email to

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