From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: lexical-binding is turned on in more use cases Date: Tue, 10 Mar 2020 19:13:28 +0000 Message-ID: <20200310191328.GB5046@ACM> References: <83o8t6bx2p.fsf@gnu.org> <83k13ubv3g.fsf@gnu.org> <83imjebsrh.fsf@gnu.org> <20200308193048.GB4832@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="89277"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 10 20:15:04 2020 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 1jBkLH-000N7j-Ra for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 20:15:03 +0100 Original-Received: from localhost ([::1]:38996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBkLG-0007pI-S5 for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 15:15:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38928) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBkJp-0006xr-33 for emacs-devel@gnu.org; Tue, 10 Mar 2020 15:13:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBkJn-0008B0-V2 for emacs-devel@gnu.org; Tue, 10 Mar 2020 15:13:32 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:13437 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1jBkJn-00088Q-Kk for emacs-devel@gnu.org; Tue, 10 Mar 2020 15:13:31 -0400 Original-Received: (qmail 89606 invoked by uid 3782); 10 Mar 2020 19:13:30 -0000 Original-Received: from acm.muc.de (p4FE1593B.dip0.t-ipconnect.de [79.225.89.59]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 10 Mar 2020 20:13:28 +0100 Original-Received: (qmail 5067 invoked by uid 1000); 10 Mar 2020 19:13:28 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:245443 Archived-At: Hello, Stefan. On Mon, Mar 09, 2020 at 17:18:12 -0400, Stefan Monnier wrote: > > I do hope we're taking Alan's concern seriously here, all joking > > aside. This change pretty harshly violates the "principle of least > > surprise", and working with lexical-scope still isn't the norm for > > most old school Emacs Lispers. I'm not sure I wuold have ever > > discovered the solution to such a problem in my own debugging, had I > > not chanced on this discussion thread. What are we gaining, again, > > at the cost of this potential confusion? > The problem is real. I don't think we can solve it without pain. You haven't answered the question. Let me put it to you in a slightly different way: What specific real problem does forcing M-: to use lexical binding solve? > Basically, M-: doesn't easily know whether to use lexical-binding or > not because it's only connected to the buffer where the code will be > run but not to some source buffer where the "related" code might > reside (and which we could try and use to guess which mode to use). Lexical binding in M-: simply isn't very useful. For any real needs, dynamic binding works better. > You're probably right that "lexical-scope still isn't the norm for most > old school Emacs Lispers", so this change will irk those. But my > impression is that the majority of *new* Elisp packages is using > lexical-binding nowadays, and the majority of Elisp snippets I see > quoted in StackExchange either work both ways or presume > lexical-binding (and then come with additional comments along the lines > of "I tried it and it didn't work ... indeed, you need to enable > lexical-binding by ... ah yes now it works"). The above paragraph is sophistry. Lexical binding in M-: simply isn't very useful, even when calling functions compiled with lexical binding. What specific real problem does forcing M-: to use lexical binding solve? > Stefan -- Alan Mackenzie (Nuremberg, Germany).