From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Declaring 'lexical-binding: nil' obsolete Date: Sat, 25 Sep 2021 15:47:45 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000000df35505ccd9a73a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="780"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 26 00:48:50 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mUGTS-000AaW-02 for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Sep 2021 00:48:50 +0200 Original-Received: from localhost ([::1]:42598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUGTQ-0006xE-Dn for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Sep 2021 18:48:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUGSU-0005ud-33 for emacs-devel@gnu.org; Sat, 25 Sep 2021 18:47:50 -0400 Original-Received: from mail-pl1-f181.google.com ([209.85.214.181]:34741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUGSS-0001pr-6w for emacs-devel@gnu.org; Sat, 25 Sep 2021 18:47:49 -0400 Original-Received: by mail-pl1-f181.google.com with SMTP id a7so9087108plm.1 for ; Sat, 25 Sep 2021 15:47:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:date:message-id:subject:to:cc; bh=F2NOV8lIu4T86XiYHhQps8FQDWd2+uytr/mUKZ5hWvU=; b=AqwggMDKnPgqob+w1MFkHpiT5GbPJoNf2QqScBAfGe1CzbELCA7X8CasH04v7nbflX Fruju+qnjsoknNzBAIyydjsAmufLXOnscTh6vY4eD0o+O0/NHZeBKGkJg30timv5RkSf rsgNlEtpuvJ5K+XGX3VakyEUiVt40mtSpKMZX9Wj2aZB0vAFlUILh7b0rplBmzZdLHr3 T/ABIsT0ZeHh48R3EzCgX61vhR/02MHGufkVg8Gg/PmmgDJ3BpOdQtAoAaZlomL+6j6U U7BgcVQhfN7JJsePrirurpt5B7U7MV2rnP0mvfvhTyLzelgq0TDeUe5ShpCtnShePGE1 eh4Q== X-Gm-Message-State: AOAM530VsWO9KsN7vQ94BDdaL4D3f+PCjl8ZYkGait24GUPilvPQQJT1 P2cOuzTS2ggUk1ts35x38SlOe6u1Im9Sk0mouurm9uAFSaU= X-Google-Smtp-Source: ABdhPJyaoOG3MLKBMYGHML6pDYc1kcFEGuVtqndhLJH6BPS/U0yOwnCatrtNcx8ZixmW2OZQYc0Z371fnZLWEoCpM5Y= X-Received: by 2002:a17:90a:5583:: with SMTP id c3mr10187298pji.133.1632610066224; Sat, 25 Sep 2021 15:47:46 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 25 Sep 2021 15:47:45 -0700 Received-SPF: pass client-ip=209.85.214.181; envelope-from=stefankangas@gmail.com; helo=mail-pl1-f181.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275486 Archived-At: --0000000000000df35505ccd9a73a Content-Type: text/plain; charset="UTF-8" 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. --0000000000000df35505ccd9a73a Content-Type: text/x-diff; charset="US-ASCII"; name="0001-Make-lexical-binding-nil-obsolete.patch" Content-Disposition: attachment; filename="0001-Make-lexical-binding-nil-obsolete.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 7494e232d9ec38fd_0.1 RnJvbSBmODZjNzBlZTBjN2U2OTUzNmMxNzQxYzMwMzc2ZTU0ZGFjN2Y4NTI2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5AbWFyeGlzdC5zZT4KRGF0 ZTogU2F0LCAyNSBTZXAgMjAyMSAyMzowODo1MyArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIE1ha2Ug J2xleGljYWwtYmluZGluZzogbmlsJyBvYnNvbGV0ZQoKKiBldGMvTkVXUzogQW5ub3VuY2Ugb2Jz b2xldGlvbiBvZiAnbGV4aWNhbC1iaW5kaW5nOiBuaWwnLgoqIGxpc3AvZW1hY3MtbGlzcC9ieXRl Y29tcC5lbCAoYnl0ZS1jb21waWxlLWZpbGUpOiBXYXJuIGlmIHRoZXJlCmlzIG5vICdsZXhpY2Fs LWJpbmRpbmcnIHN0YXRlbWVudCBvbiB0aGUgZmlyc3QgbGluZS4KKiBsaXNwL3Byb2dtb2Rlcy9l bGlzcC1tb2RlLmVsIChlbWFjcy1saXNwLW1vZGUpOiBDaGFuZ2UgdG9vbHRpcCB0bwpzYXkgdGhh dCAiZHluYW1pYyBzY29waW5nIG1vZGUiIGlzIG9ic29sZXRlLiAgVXNlIGVycm9yIGZhY2UuCldh cm4gd2hlbiBvcGVuaW5nIGEgZmlsZSB0aGF0IGRvZXMgbm90IHVzZSAnbGV4aWNhbC1iaW5kaW5n OnQnLgotLS0KIGV0Yy9ORVdTICAgICAgICAgICAgICAgICAgICAgfCAyNSArKysrKysrKysrKysr KysrKysrKysrKysrC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gICAjJ2VsaXNwLWZseW1ha2UtYnl0ZS1jb21w aWxlIG5pbCB0KQotICAoYWRkLWhvb2sgJ2NvbnRleHQtbWVudS1mdW5jdGlvbnMgIydlbGlzcC1j b250ZXh0LW1lbnUgMTAgdCkpCisgIChhZGQtaG9vayAnY29udGV4dC1tZW51LWZ1bmN0aW9ucyAj J2VsaXNwLWNvbnRleHQtbWVudSAxMCB0KQorICAod2hlbiAoYW5kIChub3QgbGV4aWNhbC1iaW5k aW5nKSBidWZmZXItZmlsZS1uYW1lKQorICAgIChtZXNzYWdlIChmb3JtYXQtbWVzc2FnZQorICAg ICAgICAgICAgICAoY29uY2F0ICJXYXJuaW5nOiBgJXMnIGlzIHVzaW5nIHRoZSBvYnNvbGV0ZSAi CisgICAgICAgICAgICAgICAgICAgICAgImBsZXhpY2FsLWJpbmRpbmc6bmlsJyB2ZXJzaW9uIG9m ICIKKyAgICAgICAgICAgICAgICAgICAgICAiRW1hY3MgTGlzcCIpCisgICAgICAgICAgICAgIChm aWxlLW5hbWUtbm9uZGlyZWN0b3J5IGJ1ZmZlci1maWxlLW5hbWUpKSkpKQogCiA7OyBGb250LWxv Y2tpbmcgc3VwcG9ydC4KIAotLSAKMi4zMC4yCgo= --0000000000000df35505ccd9a73a--