From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#44854: [PATCH] Add lexical-binding cookie to autoload files Date: Fri, 27 Nov 2020 22:39:27 +0000 Message-ID: <868samwhk0.fsf@gmail.com> References: <837dqatsjd.fsf@gnu.org> <83360ytqk3.fsf@gnu.org> <83wny9scmb.fsf@gnu.org> <83eekhs5sj.fsf@gnu.org> <83a6v5s3e3.fsf@gnu.org> <837dq9s12u.fsf@gnu.org> <83wny9qj0j.fsf@gnu.org> <83o8jkqkr3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14879"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt) To: 44854@debbugs.gnu.org Cancel-Lock: sha1:DHufDeJXxwOSz1QFh/No9aKYLpE= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 27 23:40:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kimPT-0003i1-I0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Nov 2020 23:40:11 +0100 Original-Received: from localhost ([::1]:33164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kimPS-0007T9-3E for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Nov 2020 17:40:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kimPK-0007Sf-Qo for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 17:40:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34999) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kimPK-0003ui-J5 for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 17:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kimPK-0002Pp-Fj for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 17:40:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Nov 2020 22:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16065167839254 (code B ref -1); Fri, 27 Nov 2020 22:40:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Nov 2020 22:39:43 +0000 Original-Received: from localhost ([127.0.0.1]:46545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kimP1-0002PC-3U for submit@debbugs.gnu.org; Fri, 27 Nov 2020 17:39:43 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:60702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kimOy-0002P4-Kl for submit@debbugs.gnu.org; Fri, 27 Nov 2020 17:39:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kimOy-0007N6-D6 for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 17:39:40 -0500 Original-Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:35028 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kimOx-0003qM-03 for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 17:39:40 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kimOs-00036x-V3 for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 23:39:34 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:194467 Archived-At: On Thu 26 Nov 2020, Eli Zaretskii wrote: >> From: Stefan Kangas >> Date: Wed, 25 Nov 2020 16:07:19 -0500 >> Cc: 44854@debbugs.gnu.org >> >> >> I was not discussing specifically `loaddefs.el`. >> >> The reason to change it in `loaddefs.el` now rather than later is >> >> because I can't see any benefit to doing it later. >> > >> > That's not a reason good enough in my book, sorry. >> >> FWIW, I have been working towards this crude metric: >> >> find -iname "*.el" -exec egrep -L "lexical-binding: *t" {} \; | wc -l >> >> This gives some indicator for how ready we are to "flip the switch". An >> even better metric would of course be possible, for example by counting >> SLOC or making it ignore files with side-effect free statements. But it >> hasn't seemed worth the trouble. >> >> Also, the above metric can easily be converted to a TODO-list: >> >> find -iname "*.el" -exec egrep -L "lexical-binding: *t" {} \; | sort >> >> This is how I've been using it. I've been looking to make the number of >> files go down by adding the cookie to even insignificant files, as they >> stand in the way of seeing the files that actually need work.[1] >> >> May I ask why you are against it? If we agree that it should make no >> difference one way or the other, why not just do it? > > I have nothing against converting Lisp files to lexical-binding, and > have never objected to any of your recent changes in that direction. > But this makes sense only in files which be affected by that, and > autoloads files aren't. "Converting" them to lexical-binding, and > modifying the code which produces those files on top of that, sounds > like we are afraid of our own shadows, or don't know what > lexical-binding is about (or both). If adding a lexical-binding tag has no effect on the autoload files (other than making them a few bytes larger), then it should be of no consequence. The "conversion" would be the same as for many other files that did not require any substantive code changes. Adding the tag to the autoloads is not about needing code changes, but simply a marker that those files are ready for the flip-the-switch event. > My point is that when the time comes to "flip the switch", we can do > that without having lexical-binding in autoloads files. They cannot > be affected by the switch. If they are, it's probably some subtle bug > somewhere. However, by treating all .el files uniformly (including autoloads), it makes it easier to write scripts that check for lexical binding support in source files. Simplifying the conversion process help to ensure that a future flip-the-switch flag day is less likely to introduce problems. AndyM