From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66706: [PATCH] Automatic elisp dialect insertion Date: Tue, 24 Oct 2023 22:01:25 -0400 Message-ID: References: <17C83052-7946-45DE-B660-DA7EB82001B0@gmail.com> <83sf61mb54.fsf@gnu.org> <98CD592C-0E82-4795-8168-2B5E597FF7A7@gmail.com> <8334xzlvy9.fsf@gnu.org> <87pm131pq6.fsf@yahoo.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22680"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 66706@debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , stefankangas@gmail.com To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 25 04:02:48 2023 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 1qvTEO-0005hV-JW for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Oct 2023 04:02:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvTEB-0006fK-6C; Tue, 24 Oct 2023 22:02:35 -0400 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 1qvTE9-0006eu-7h for bug-gnu-emacs@gnu.org; Tue, 24 Oct 2023 22:02:33 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvTE8-0000Gg-SB for bug-gnu-emacs@gnu.org; Tue, 24 Oct 2023 22:02:32 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qvTEc-00070A-CI for bug-gnu-emacs@gnu.org; Tue, 24 Oct 2023 22:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Oct 2023 02:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66706 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66706-submit@debbugs.gnu.org id=B66706.169819932826842 (code B ref 66706); Wed, 25 Oct 2023 02:03:02 +0000 Original-Received: (at 66706) by debbugs.gnu.org; 25 Oct 2023 02:02:08 +0000 Original-Received: from localhost ([127.0.0.1]:56972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvTDk-0006ys-1s for submit@debbugs.gnu.org; Tue, 24 Oct 2023 22:02:08 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvTDf-0006yK-0N for 66706@debbugs.gnu.org; Tue, 24 Oct 2023 22:02:06 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 56CD9803B1; Tue, 24 Oct 2023 22:01:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1698199285; bh=KK0xGyLB0lBmus9YkhWy1Qv/8iCiLOGjMC3/egMCam4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nWAOmpbWTfPett9dpK/4G1S/cZk70CW2dJdc9so7hzoyI4KH1ee9hPnBuuv3fibfu n2eZIDvB6Ha1ITtNYVJ+A+I707qkkKWtC8xNIHJGjtliwCOFSzbga6bWlMqYZPxSkI Vb91vTbeQf++GD0jLehg1ZM9e7pBONOEGXRbtKyhhhYYOrVw/JEoldEwOULyo5iHRa kgXDqiiyi91xMTgElTy7jd/rBGU9QoxKq3t4xCvvwIW8nA93KLyZZ3OVsuUuAbLw06 1gdqtQbYK9KfSJFqrnD4MWal73u8i0rMrefWGCUb4HF0Tfuq64AMLQaeQ8MYr9gFzJ +X7zKrwe20NCQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D835F80257; Tue, 24 Oct 2023 22:01:25 -0400 (EDT) Original-Received: from pastel (unknown [45.72.216.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A11EA12025A; Tue, 24 Oct 2023 22:01:25 -0400 (EDT) In-Reply-To: <87pm131pq6.fsf@yahoo.com> (Po Lu's message of "Wed, 25 Oct 2023 08:59:45 +0800") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273134 Archived-At: > I want this off by default. We teach users to enable lexical binding in > the Lisp introduction and a myriad of other places; inserting lexical > binding cookies is not "the icing on the cake", but a gesture that > implies we should override the judgement of our users, and are willing > to browbeat them into abiding by such notions of ours. The lexbind dialect is the dialect we recommend: Lately Emacs is moving towards using lexical binding in more and more places, with the goal of eventually making lexical binding the default. In particular, all Emacs Lisp source files and the @file{*scratch*} buffer use lexical scoping. So why should a new file default to using the dynbind dialect instead? > Similar measures taken by other software bespeaks the existence of a > sense of superiority in their developers; doubtless, We simply can't satisfy everyone: either we impose the dynbind dialect by default (the current situation) or we impose the lexbind dialect by default. In both cases you can look at it as something imposed out of a sense of superiority, but I don't think that is a useful way to look at it. > they think it beyond their users to read several pages of > documentation pertaining to lexical binding, and to make from that an > informed decision. Those users who read all the docs can easily turn that option off if they so wish. We shouldn't decide on what's a good defaults based on them. > We never insert text to enforce our conceptions of good practice in any > major mode. Such is the first step down a very precipitous slope, which > culminates in the adoption of the haughty attitude that other software > has seized upon with particular zeal. Just to be clear: the long term goal is to eliminate the dynbind dialect, or at least make it be an opt-in that requires taking extra steps, such as adding a cookie to the file, whereas the lexbind dialect should be the default. Not because dynbind is evil. Not because it imposes an undue burden on the implementation. But because having two dialects imposes an undue burden on our users. Those who read all the docs may not care, but all the others are vulnerable to the usual "I copied the code from that webpage and it doesn't work" because the code on that webpage used the other dialect. So the question is how to move from here to there in the least painful way and I believe that inserting this cookie by default is a step that will make this transition less painful. Stefan