From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#30078: 27.0.50; Use lexical-binding for M-: Date: Mon, 19 Mar 2018 15:32:23 -0400 Message-ID: References: <87h8rsaz8z.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1521487874 18276 195.159.176.226 (19 Mar 2018 19:31:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Mar 2018 19:31:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 30078@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 19 20:31:10 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ey0Uv-0004g0-8t for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Mar 2018 20:31:09 +0100 Original-Received: from localhost ([::1]:43565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey0Wy-0007sQ-JL for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Mar 2018 15:33:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey0Wp-0007rz-KX for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 15:33:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey0Wk-0008Ne-MQ for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 15:33:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34284) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ey0Wk-0008NY-Hv for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 15:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ey0Wk-0001Fd-B9 for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 15:33: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: Mon, 19 Mar 2018 19:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30078 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30078-submit@debbugs.gnu.org id=B30078.15214879474760 (code B ref 30078); Mon, 19 Mar 2018 19:33:02 +0000 Original-Received: (at 30078) by debbugs.gnu.org; 19 Mar 2018 19:32:27 +0000 Original-Received: from localhost ([127.0.0.1]:42181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ey0WA-0001Ei-N4 for submit@debbugs.gnu.org; Mon, 19 Mar 2018 15:32:26 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:35724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ey0W9-0001Ea-Cb for 30078@debbugs.gnu.org; Mon, 19 Mar 2018 15:32:25 -0400 Original-Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w2JJWOeO017693; Mon, 19 Mar 2018 15:32:24 -0400 Original-Received: by lechazo.home (Postfix, from userid 20848) id 125B0632A7; Mon, 19 Mar 2018 15:32:24 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Fri, 12 Jan 2018 11:12:23 -0500") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6245=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6245> : inlines <6504> : streams <1781675> : uri <2611203> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144417 Archived-At: > I figured M-x ielm would qualify as well. Seeing how forcing lexical-binding within *ielm* raised some objections, I've changed my patch so it only sets lexical-binding in the *ielm* buffer but the evaluation mode will still depend on the lexical-binding setting in ielm-working-buffer (so evaluating `lexical-binding' will again return a value which indicates whether expressions are evaluated using lexical-binding). New patch below. There were some issues regarding the general long term goal of standardizing on lexical-binding. So I'm restarting this discussion below. I wrote: > > I very much hope to see Emacs shed its dynbind-Elisp support at some > > point, tho it still seems to be a pretty distant future and I'm not even > > sure how we'll get to that point. To which Eli replied: > It's quite clear that these are your views, but going in that > direction should be an explicit project-wide decision, widely agreed > and accepted by main project contributors. Doing it one subtle step > at a time is not the right way, IMO. If and when such a decision is > made, we would not need to have these discussions, we could simply go > lexical-bind as quickly as it's practical. Fully agreed. FWIW, this is the decision I took when I added lexical-binding into Emacs-24.1. I had no idea that someone might like to disagree: the lexbind-Elisp language is a strict superset of the dynbind-Elisp language and for that reason I don't see any reason other than backward compatibility to keep dynbind-Elisp. I'm not trying to fool people by "doing it one subtle step at a time", I'm only trying to make this switch as painless as possible. I don't yet have a plan for how we'll get rid of dynbind-Elisp and I'm sure it'll take many years and several more steps, some of them less subtle than others. Some of the steps I could imagine introducing in the not too distant future: - finish converting all Emacs's .el files to use lexical-binding:t. - emit a warning when opening an Elisp file which doesn't specify `lexical-binding:t' in its local vars. - emit a warning when `eval` is called without a nil 2nd arg. AFAICT by looking at packages on github, lexical-binding is very popular, despite the fact that it limits packages to Emacs=E2=89=A524 and requires explicitly adding a magic cookie on the first line. Also I've only gotten positive feedback so far about it (more specifically, the above paragraph of yours is the most negative feedback I've hard about lexical-binding so far). Eli also wrote: > Do we know for a fact that most users who extend Emacs by writing > their own Lisp have background in Lisps and other similar languages > where lexical binding is the default? If not, dynamic binding might > be easier to grasp for the newcomers. Lexical scoping is not specific to Lisp or similar languages: it's the scoping supported by virtually all programming languages such as Javascript, Pascal, Fortran, Smalltalk, C, Python, Rust, Java, C#, Clojure, Ruby, Perl, ... The vast majority of those *only* supports lexical scoping. It's dynamic binding which is the odd one out: I can't think of too many languages supporting dynamic scoping other than Scheme, Common-Lisp, Elisp, Logo, sh, and Perl (and maybe Awk tho the doc I can find doesn't make it clear), most of which also support lexical scoping (the only exceptions I know are Logo, sh, and maybe Awk). Stefan