From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: Default lexical-binding to t Date: Thu, 07 Nov 2024 18:00:44 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23448"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 08 00:01:40 2024 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 1t9BVT-0005uz-CC for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Nov 2024 00:01:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9BUf-00069R-7H; Thu, 07 Nov 2024 18:00:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9BUd-00069G-AI for emacs-devel@gnu.org; Thu, 07 Nov 2024 18:00:47 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9BUd-0002wP-1b for emacs-devel@gnu.org; Thu, 07 Nov 2024 18:00:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=bst5RxH6hzybyx6jNWQkHElACUadpvdoh5HrVFe9zXk=; b=EYvVZ6gq5pv75fLodOQ3 9VBfln6xrL6z5MWnEm30xpvIiDxBazkNF2SWgfbm9VNfl6CcHLAcunorr1S7cr6kyhnrimKKiKUBZ LwX5ErqdqZD92omSIWq5S4B/VXVaJ6pG5Vb/V3DEe8hb6tmMIqD+oPHAzEY50DBdE8yHY+WbyaRkN TIW7Uc/B8lCxUPzvJj7/DLiMF+zpfKkCpYh1oggi9NuYs/IjL1fTyInu9gLT++y6/nVdcIXcH7Gm7 IeuNl48tmQpNl3Qen6t/7Y42LbFTw83a25Lu7WAY2LLIGUXI0FcTrdQNu3DJD8egRQvZ0ALUhlWiX 93Z5cT+LU7sD8Q==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1t9BUa-0000dI-C9; Thu, 07 Nov 2024 18:00:44 -0500 In-Reply-To: (Richard Stallman's message of "Wed, 06 Nov 2024 22:46:38 -0500") X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325244 Archived-At: Richard Stallman writes: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > > > I believe by the time Emacs-31 will be released, such files will be > > > uncommon, and it is easy to fix them (either by adjusting he code, or > > > by slapping a `lexical-binding` cookie). > > > I support this, together with the idea of having a warning when loading > > file without the cookie. We can always remove the warning (and the > > cookies) in the future when/if we feel it's time. > > If the goal is to lead ysers to indicate this explicitly in each file, > it is enough to complain about files that lack a file local variable > specification for this variable. It could do this whenever it visits > a file in Emacs Lisp mode. But a user could one day upgrade Emacs to a new emacs (with lexical-binding t) and, without any feedback from Emacs, load an old file with no cookie that was designed for dynamic bindings now interpreted as lexical. Most people load files without first fisiting them, so I still think the load time warning idea has some advantage. > If we want to increase the pressure to label old files explicitly, > we could go beyond a warning. For instance, we could ask the user > whether. "Is this an old file thjt is supposed to use dynamic binding?" > > If the user answers yes to that, Emacs could offer to modify the file, > adding a tag. Yep that would be doable too. I think increasing the pressure to label old files explicitly is the goal here. > By contrast, to change the interpretation of files that don't specify > the variable is ineffective for the purpuse. But it will waste a lot > of long-time users' time in figuring out what went wrong. > > Eli wrote: > > > If we urge people to specify lexical-binding in their files, then what > > is the point of making lexical-binding the default? > > Perhaps there is no reason to change the default itself ;-). Perhaps > what we _should_ want is to put an end, among somewhat-maintained > programs, to dependence on the old defaull. > > The methods described above will do the job better and faster than > changing the default, and much more gently too. I believe having code with no cookie interpreted as lexical is anyway the (final) goal on this subject. Given all new code is lexically scoped, one day would be nice not to have to keep on writing the cookie. The cookie AFAIU was a workaraund put in place to have the coexistence of the two dialects possible and allow for the transition, it is/was a useful tool but would be nice in the future not to be forced to use it everywhere. Regards Andrea