all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eduardo Ochs <eduardoochs@gmail.com>
To: Stefan Kangas <stefan@marxist.se>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: Declaring 'lexical-binding: nil' obsolete
Date: Sat, 25 Sep 2021 20:56:58 -0300	[thread overview]
Message-ID: <CADs++6hRmZc1SA3EM9Hm-758LEMrYfav_mgZ4TT29oTzB2nGww@mail.gmail.com> (raw)
In-Reply-To: <CADwFkmkDC1S2RFXPS5uhcGFVgo0xzzMx+FEAgAgX8t9a3GHOBQ@mail.gmail.com>

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.



  parent reply	other threads:[~2021-09-25 23:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-25 22:47 Declaring 'lexical-binding: nil' obsolete Stefan Kangas
2021-09-25 23:17 ` Po Lu
2021-09-26  0:04   ` Stefan Kangas
2021-09-26  0:13     ` Po Lu
2021-09-26  0:50       ` Stefan Kangas
2021-09-26  1:20         ` Po Lu
2021-09-26  2:37           ` Stefan Kangas
2021-09-26  2:55             ` Po Lu
2021-09-26  6:30         ` Eli Zaretskii
2021-09-26  6:08       ` Eli Zaretskii
2021-09-26  6:06     ` Eli Zaretskii
2021-09-25 23:56 ` Eduardo Ochs [this message]
2021-09-26  0:35   ` Stefan Kangas
2021-09-26  6:02 ` Eli Zaretskii
2021-09-26  6:36   ` Lars Ingebrigtsen
2021-09-27 22:35 ` Deprecating 'lexical-binding: nil' Richard Stallman
2021-09-27 23:09   ` Stefan Kangas
2021-09-28  1:42     ` Stefan Monnier
2021-09-30  6:03     ` Richard Stallman
2021-09-30 14:18       ` Steingold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADs++6hRmZc1SA3EM9Hm-758LEMrYfav_mgZ4TT29oTzB2nGww@mail.gmail.com \
    --to=eduardoochs@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.