From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 11 11:37:11 2018 Received: (at submit) by debbugs.gnu.org; 11 Jan 2018 16:37:11 +0000 Received: from localhost ([127.0.0.1]:52390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZfqo-0002Hd-2y for submit@debbugs.gnu.org; Thu, 11 Jan 2018 11:37:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZfql-0002HQ-PR for submit@debbugs.gnu.org; Thu, 11 Jan 2018 11:37:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZfqf-0007xt-Kk for submit@debbugs.gnu.org; Thu, 11 Jan 2018 11:37:02 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZfqf-0007xe-He for submit@debbugs.gnu.org; Thu, 11 Jan 2018 11:37:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZfqe-0007ej-AH for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2018 11:37:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZfqZ-0007nx-Am for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2018 11:37:00 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:41546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZfqZ-0007nb-6I for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2018 11:36:55 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0BGasdb030646 for ; Thu, 11 Jan 2018 11:36:54 -0500 Received: by pastel.home (Postfix, from userid 20848) id 453966231F; Thu, 11 Jan 2018 11:36:54 -0500 (EST) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: 27.0.50; Use lexical-binding for M-: Date: Thu, 11 Jan 2018 11:36:54 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.3 X-NAI-Spam-Rules: 5 Rules triggered BEC_TRC1=0.1, BEC_TRC1_W_GEN_SPAM_FEATRE=0.1, GEN_SPAM_FEATRE=0.1, EDT_SA_DN_PASS=0, RV6198=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6198> : inlines <6305> : streams <1775762> : uri <2568106> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Package: Emacs Version: 27.0.50 I think we should slowly move towards making lexical-binding the default and we could start by making M-: always use lexical binding. WDYT? Stefan diff --git a/lisp/simple.el b/lisp/simple.el index 4c69e0f6ff..fa31ef9f0f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1608,12 +1608,12 @@ eval-expression (eval-expression-get-print-arguments current-prefix-arg))) (if (null eval-expression-debug-on-error) - (push (eval exp lexical-binding) values) + (push (eval exp t) values) (let ((old-value (make-symbol "t")) new-value) ;; Bind debug-on-error to something unique so that we can ;; detect when evalled code changes it. (let ((debug-on-error old-value)) - (push (eval (macroexpand-all exp) lexical-binding) values) + (push (eval (macroexpand-all exp) t) values) (setq new-value debug-on-error)) ;; If evalled code has changed the value of debug-on-error, ;; propagate that change to the global binding. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 11 15:59:07 2018 Received: (at 30078) by debbugs.gnu.org; 11 Jan 2018 20:59:07 +0000 Received: from localhost ([127.0.0.1]:52523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZjwJ-0008L7-9e for submit@debbugs.gnu.org; Thu, 11 Jan 2018 15:59:07 -0500 Received: from mout.web.de ([217.72.192.78]:53197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZjwH-0008Ke-Ql for 30078@debbugs.gnu.org; Thu, 11 Jan 2018 15:59:06 -0500 Received: from drachen.dragon ([92.74.168.127]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MBTIY-1egvkH1jlO-00AUKv; Thu, 11 Jan 2018 21:58:55 +0100 From: Michael Heerdegen To: Stefan Monnier Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: Date: Thu, 11 Jan 2018 21:58:52 +0100 In-Reply-To: (Stefan Monnier's message of "Thu, 11 Jan 2018 11:36:54 -0500") Message-ID: <87h8rsaz8z.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:Zah6kBfUco9Pw1jZAl1sv3CvOHjyOvxkZYnClz8lFok/bIB5twY /DTY+jKG/yxNDkgmfev86rpy1j9oLRe0Ctx+Sr6zCVTj9wupmQMHvFlrAU+FYuw5BJcoN6l Ho37NosyTCa6bPrNKRBp4CxouMx4rmAaXwn9DJH6x3p1X9A6Gbdas4WYzQ7BLO39ffcvM6T s4zoeEDp1lRpByCZuC7Tg== X-UI-Out-Filterresults: notjunk:1;V01:K0:HLgjAJKz0jI=:YEPFZ1uIquL3Y+wMf2aZ7n bh3kYJYSmz9e0PYdvD5bMtSxg1qXcO6fM14+CosT/uMOjnePVzOW1zwkqNny5KphzMiNVf/jT kdrFt/pSw4QlLWPeD3mPiOJASl8PHfR3AK+hnGr0WSJrBuVcvBeurDNRdFBNENG/ZOfduE/07 tz4y9gmLVGZCkfc/REmBMfE76DDJ/yckzEKl0Dhj1qUUoygFUZCSCFb3qBsEMmnWxQnbwMevR CsNrozAmoQfTPhp+buXREWcqMdC8+d7A3vHyi4wc0jlqsfAbKLm2nHjYAgGul7J3bfrTSuouH Y6iSOojIslXBtxF4jUguDIxrvjNw6/smMxSOsZu21EcvyXs3wlVhbdoSFkI8eQVV8KyAtIYCA IwSYORv2I+GQOAaGd7Lg3zk43vwqEdTKWp9r+3HWYEizy3G1eVvVhWYjNNgYh3lipMgmtFthm AkTlK2ayvZEo+J40ZnzmL5vi4GvF9/pULp1yfRW2+UKPvDFOklDS+aMHYk3djFVfApcWz9Api 4OndnRTHbWKFdPXIowODdSECGl/oySg/cFm2jCFcs2LcPzYud12VAQCpTNrvEVEjKVVVoS049 gMGeijVBoW1lRYNUyvP34bf+Tf3AjVlzyjNv6cOAL3e2m3jvnjTLyShAG48iP/gRQzelqY7rz TYl9VBY3ZxYM2H3J05/kDsp+oskYzpPsZu9FYGNIEO3gRooST+PuUgxxKHUEPRavYw2hvstUi zKsmYu34QQT6sCUjmtTqJbRJdtzrVvxSoRqsxOKJn4RB8cI9IACMwHinc6Y389AAvbxztU/ra ukLtpvp6lb4Qf4gwbQPgWaQo1Y+IlvvLU8GO6SZJr0GUmnUB6g= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30078 Cc: 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stefan Monnier writes: > I think we should slowly move towards making lexical-binding the default > and we could start by making M-: always use lexical binding. > WDYT? Why not? But maybe we should keep this consistent with C-x C-e in *scratch* to avoid confusion (a la "why do the evaluation results differ?"), i.e. enable lexical-binding in *scratch* at the same time? Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 09:54:36 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 14:54:36 +0000 Received: from localhost ([127.0.0.1]:53057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea0j5-0008Av-Uv for submit@debbugs.gnu.org; Fri, 12 Jan 2018 09:54:36 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:41123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea0j4-0008An-Jr for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 09:54:34 -0500 Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0CEsXvt004051; Fri, 12 Jan 2018 09:54:33 -0500 Received: by lechazo.home (Postfix, from userid 20848) id 967F46062F; Fri, 12 Jan 2018 09:58:17 -0500 (EST) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> Date: Fri, 12 Jan 2018 09:58:17 -0500 In-Reply-To: <87h8rsaz8z.fsf@web.de> (Michael Heerdegen's message of "Thu, 11 Jan 2018 21:58:52 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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, RV6199=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6199> : inlines <6309> : streams <1775849> : uri <2568895> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >> I think we should slowly move towards making lexical-binding the default >> and we could start by making M-: always use lexical binding. >> WDYT? > Why not? > But maybe we should keep this consistent with C-x C-e in *scratch* to > avoid confusion (a la "why do the evaluation results differ?"), > i.e. enable lexical-binding in *scratch* at the same time? Good idea. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 11:08:44 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 16:08:44 +0000 Received: from localhost ([127.0.0.1]:54001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea1sp-0001jE-P0 for submit@debbugs.gnu.org; Fri, 12 Jan 2018 11:08:44 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:58284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea1sn-0001j5-2T for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 11:08:42 -0500 Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0CG8dVG018262; Fri, 12 Jan 2018 11:08:39 -0500 Received: by lechazo.home (Postfix, from userid 20848) id 7ACF96062F; Fri, 12 Jan 2018 11:12:23 -0500 (EST) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> Date: Fri, 12 Jan 2018 11:12:23 -0500 In-Reply-To: (Stefan Monnier's message of "Fri, 12 Jan 2018 09:58:17 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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, RV6199=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6199> : inlines <6309> : streams <1775854> : uri <2568941> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >>> I think we should slowly move towards making lexical-binding the default >>> and we could start by making M-: always use lexical binding. >>> WDYT? >> Why not? >> But maybe we should keep this consistent with C-x C-e in *scratch* to >> avoid confusion (a la "why do the evaluation results differ?"), >> i.e. enable lexical-binding in *scratch* at the same time? > Good idea. I figured M-x ielm would qualify as well. How 'bout this patch, then? Stefan diff --git a/etc/NEWS b/etc/NEWS index f6f36dfc85..d7e84eca7f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -52,6 +52,10 @@ to reduce differences between developer and production builds. * Changes in Emacs 27.1 +** Lexical binding is now used when evaluating interactive Elisp forms +More specifically, lexical-binding is used for M-:, M-x ielm, as well +as in the *scratch* buffer. + --- ** The new option 'tooltip-resize-echo-area' avoids truncating tooltip text on GUI frames when tooltips are displayed in the echo area. Instead, diff --git a/lisp/ielm.el b/lisp/ielm.el index fb285e80f6..cad1bded4f 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -408,8 +408,7 @@ ielm-eval-input (setf standard-output new-standard-output)) (kill-buffer (current-buffer)) (set-buffer wbuf) - (setq result - (eval form lexical-binding)) + (setq result (eval form t)) (setq wbuf (current-buffer)) (setq ielm-temp-buffer diff --git a/lisp/server.el b/lisp/server.el index ac0d701851..918197ab44 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1294,7 +1294,7 @@ server-execute ((functionp initial-buffer-choice) (funcall initial-buffer-choice))))) (switch-to-buffer - (if (buffer-live-p buf) buf (get-buffer-create "*scratch*")) + (if (buffer-live-p buf) buf (startup--get-buffer-create-scratch)) 'norecord))) ;; Delete the client if necessary. diff --git a/lisp/simple.el b/lisp/simple.el index 87e0b23377..e2d3cd1505 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1555,12 +1555,12 @@ eval-expression (eval-expression-get-print-arguments current-prefix-arg))) (if (null eval-expression-debug-on-error) - (push (eval exp lexical-binding) values) + (push (eval exp t) values) (let ((old-value (make-symbol "t")) new-value) ;; Bind debug-on-error to something unique so that we can ;; detect when evalled code changes it. (let ((debug-on-error old-value)) - (push (eval (macroexpand-all exp) lexical-binding) values) + (push (eval (macroexpand-all exp) t) values) (setq new-value debug-on-error)) ;; If evalled code has changed the value of debug-on-error, ;; propagate that change to the global binding. diff --git a/lisp/startup.el b/lisp/startup.el index 688ea84b7b..f3c0c7b100 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -2095,7 +2095,7 @@ normal-no-mouse-startup-screen (insert "\t\t") (insert-button "Open *scratch* buffer" 'action (lambda (_button) (switch-to-buffer - (get-buffer-create "*scratch*"))) + (startup--get-buffer-create-scratch))) 'follow-link t) (insert "\n") (insert "\n" (emacs-version) "\n" emacs-copyright "\n") @@ -2221,6 +2221,12 @@ display-about-screen (defalias 'about-emacs 'display-about-screen) (defalias 'display-splash-screen 'display-startup-screen) +(defun startup--get-buffer-create-scratch () + (with-current-buffer (get-buffer-create "*scratch*") + (set-buffer-major-mode (current-buffer)) + (setq-local lexical-binding t) + (current-buffer))) + (defun command-line-1 (args-left) "A subroutine of `command-line'." (display-startup-echo-area-message) @@ -2485,7 +2491,7 @@ command-line-1 (when (eq initial-buffer-choice t) ;; When `initial-buffer-choice' equals t make sure that *scratch* ;; exists. - (get-buffer-create "*scratch*")) + (startup--get-buffer-create-scratch)) ;; If *scratch* exists and is empty, insert initial-scratch-message. ;; Do this before switching to *scratch* below to handle bug#9605. @@ -2504,7 +2510,7 @@ command-line-1 ((functionp initial-buffer-choice) (funcall initial-buffer-choice)) ((eq initial-buffer-choice t) - (get-buffer-create "*scratch*")) + (startup--get-buffer-create-scratch)) (t (error "initial-buffer-choice must be a string, a function, or t."))))) (unless (buffer-live-p buf) diff --git a/lisp/window.el b/lisp/window.el index d7fdceb205..7f89c87af1 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4578,7 +4578,7 @@ last-buffer (or (get-next-valid-buffer (nreverse (buffer-list frame)) buffer visible-ok frame) (get-buffer "*scratch*") - (let ((scratch (get-buffer-create "*scratch*"))) + (let ((scratch (startup--get-buffer-create-scratch))) (set-buffer-major-mode scratch) scratch))) From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 11:53:53 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 16:53:53 +0000 Received: from localhost ([127.0.0.1]:54047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea2aX-0002ra-H8 for submit@debbugs.gnu.org; Fri, 12 Jan 2018 11:53:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea2aW-0002rP-4M for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 11:53:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea2aQ-0006X6-Bw for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 11:53:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea2aM-0006NZ-3S; Fri, 12 Jan 2018 11:53:42 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1ea2aL-0002C1-Il; Fri, 12 Jan 2018 11:53:41 -0500 From: Glenn Morris To: Stefan Monnier Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> X-Spook: Qaddafi FBI spies CIDA SWAT Shelter-in-place Secret X-Ran: Ex?ii,\5YD)-Ya6 (Stefan Monnier's message of "Fri, 12 Jan 2018 11:12:23 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: Michael Heerdegen , 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Stefan Monnier wrote: > How 'bout this patch, then? You forgot all the documentation updates. :) From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 12:23:47 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 17:23:47 +0000 Received: from localhost ([127.0.0.1]:54063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea33T-0003eO-E3 for submit@debbugs.gnu.org; Fri, 12 Jan 2018 12:23:47 -0500 Received: from mout.web.de ([212.227.17.11]:53973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea33R-0003e4-Sj for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 12:23:46 -0500 Received: from drachen.dragon ([92.74.168.127]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MN4Kq-1eTSPP1JO4-006e5g; Fri, 12 Jan 2018 18:23:35 +0100 From: Michael Heerdegen To: Stefan Monnier Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> Date: Fri, 12 Jan 2018 18:23:34 +0100 In-Reply-To: (Stefan Monnier's message of "Fri, 12 Jan 2018 11:12:23 -0500") Message-ID: <871sivf0tl.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:48La97Tp93ip2LDyOF5tIwovi5F2Q+A6O8/BU98gTnSyVM3K3an LS7P7+A5HngcwLE0uEVReFU3gUzve2KS82tg9z+6oLUaLCoiZ1SkBKsTlFXthUCxd0UYLQF 4LQZfZQP36MHxnsF4f8DVVYTPA+q2KZIforkmFGvrJuRPbjaMwoVg+28i/g6Ub1TptNxOx3 5iuRjisqEe6JGbPetOO9A== X-UI-Out-Filterresults: notjunk:1;V01:K0:cByHrges+lY=:E91YeGZ1bDW6BCVLRX1UHX MGMFA5K33sres9YRo5sXjOUoGuUzvAZxosdoCquyC6aD5lRBorx7k64UP9eIlplz0yAd+CcrA nNhW7GoxajrD7Tfrdct7feCw8uOC+/fDo7QgxbhBFGBeJXsFxYH14pL1Y3RjtJAhR43b4K0DM QdKZRJYScUVBzmSI6XU882kjvybxX28p6FcxTTnpPcz6DOxVrp6L5ZdRqlDkOJhAMTwSYeBRA jbCE1oitc6Uwf0DrLLr7YYMIiNg60qJyMrxcv1nyDACSIh6HbtLBYCnPY82RZYvRaXL4XM54X dmL1QCD6iLrcjplSTOSsxJjApBHm4jzEcxCcUCP4jPb/YGx2MmTPZcnVixb+t9onAKh4VwcBZ 130NVo+eLctfhNc1vLFb0/XTroJYhmVe9TC7fdLiGn2gHl3RziDCgU46a1HQmEa2nZEI7ujpg nllt5F80f5upn8RGaBEj+GygWUuBW5QvTIxXHIG/UsrMX4xZ97//3RMz88VR5f/4f7n+3CVYV 7Q6dmsSJWDzpM/zw9wTh+NXpgwkVt3Fsd2UOsGm/5lgZTFDomK+TXyd9i8D+aGXWAPANuUvvl EeFlB9o2vQ+YmFIjnD2lOx4QCHN48EUjfgydG0Wujp4oD2oW5gwqAM+UtV3mPvcdHJbF4yzpF DNh/VNR/eUsu+Sypb4uo+qMtKNtO3ZvlVfscSzRwGSkNxt8WM7AZJrSNyVY/0vVHhEep+Z0pS tBCm7gdIyeBWsFF//HS5awLBPMrZvI1EUgMgKGtH+i5YRgYB29c9BqGH/1yYA4WwHIueEFhaI ZGwDQg0qaEreWx9rCvCywdHnxoTezRDMW5shNQUknxquD5YlOM= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30078 Cc: 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stefan Monnier writes: > (defun command-line-1 (args-left) > "A subroutine of `command-line'." > (display-startup-echo-area-message) > @@ -2485,7 +2491,7 @@ command-line-1 > (when (eq initial-buffer-choice t) > ;; When `initial-buffer-choice' equals t make sure that *scratch* > ;; exists. > - (get-buffer-create "*scratch*")) > + (startup--get-buffer-create-scratch)) > > ;; If *scratch* exists and is empty, insert initial-scratch-message. > ;; Do this before switching to *scratch* below to handle bug#9605. Don't you also want to change this occurrence in `command-line'? #+begin_src emacs-lisp ;; If *scratch* exists and init file didn't change its mode, initialize it. (if (get-buffer "*scratch*") (with-current-buffer "*scratch*" (if (eq major-mode 'fundamental-mode) (funcall initial-major-mode)))) #+end_src So far, lexical-binding in *scratch* is nil with emacs -Q with your patch. Maybe also check that evaluating the expression `lexical-binding' returns a result that is consistent with the evaluation behavior. In particular, evaluating lexical-binding in M-x ielm RET still gives nil - that's confusing. Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 13:34:57 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 18:34:58 +0000 Received: from localhost ([127.0.0.1]:54113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea4AL-0007HN-OH for submit@debbugs.gnu.org; Fri, 12 Jan 2018 13:34:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea4AK-0007H9-9B for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 13:34:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea4AB-0004Dg-VB for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 13:34:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea4AB-0004DE-Rj; Fri, 12 Jan 2018 13:34:47 -0500 Received: from [176.228.60.248] (port=4224 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ea4AB-0005Rj-6Q; Fri, 12 Jan 2018 13:34:47 -0500 Date: Fri, 12 Jan 2018 20:34:27 +0200 Message-Id: <838td32afg.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Fri, 12 Jan 2018 11:12:23 -0500) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Stefan Monnier > Date: Fri, 12 Jan 2018 11:12:23 -0500 > Cc: 30078@debbugs.gnu.org > > +** Lexical binding is now used when evaluating interactive Elisp forms > +More specifically, lexical-binding is used for M-:, M-x ielm, as well > +as in the *scratch* buffer. Please, not in *scratch*. Setting variables and then evaluating forms that use them is very useful there. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 13:43:26 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 18:43:26 +0000 Received: from localhost ([127.0.0.1]:54117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea4IY-0007Sp-Ig for submit@debbugs.gnu.org; Fri, 12 Jan 2018 13:43:26 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:50189) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea4IW-0007Sh-Gh for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 13:43:24 -0500 Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0CIhNXA004478; Fri, 12 Jan 2018 13:43:23 -0500 Received: by lechazo.home (Postfix, from userid 20848) id 6AA136030E; Fri, 12 Jan 2018 13:47:07 -0500 (EST) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> <871sivf0tl.fsf@web.de> Date: Fri, 12 Jan 2018 13:47:07 -0500 In-Reply-To: <871sivf0tl.fsf@web.de> (Michael Heerdegen's message of "Fri, 12 Jan 2018 18:23:34 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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, RV6199=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6199> : inlines <6310> : streams <1775865> : uri <2569026> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Don't you also want to change this occurrence in `command-line'? > > #+begin_src emacs-lisp > ;; If *scratch* exists and init file didn't change its mode, initialize it. > (if (get-buffer "*scratch*") > (with-current-buffer "*scratch*" > (if (eq major-mode 'fundamental-mode) > (funcall initial-major-mode)))) > #+end_src Ah, so that's where it is, thanks. > So far, lexical-binding in *scratch* is nil with emacs -Q with your > patch. That's what I was seeing as well, indeed :-( > Maybe also check that evaluating the expression `lexical-binding' > returns a result that is consistent with the evaluation behavior. I already know that the check will fail. Is it important? In general the value of the variable lexical-binding during evaluation of the code is not directly related to whether the code is evaluated using lexical rules or not. Within macros, Emacs tries to make sure that lexical-binding reflects whether the code returned by the macro will use lexical scoping or not (so that the macro can adjust the code it generates accordingly), but other than that, the two are largely independent (which is why (setq lexical-binding t) is not the right way to enable lexical scoping in a file). > In particular, evaluating lexical-binding in M-x ielm RET still gives > nil - that's confusing. Right (well, it doesn't always give you nil: it depends on the value of lexical-binding in the buffer currently selected to evaluate the IELM expressions). But this discrepancy also shows up in various other contexts. Eg.: ;; -*- lexical-binding:t -*- (defun my-test () (interactive) (message "%S" lexical-binding)) will give you a lexically scoped command which will tell you the value of lexical-binding at the time&place you run the command, which will sometimes be t and sometimes not. I'm not sure we should try to encourage the user to think a piece of code can check the value of `lexical-binding` to know if it's being evaluated using lexical scoping rules. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 13:45:20 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 18:45:20 +0000 Received: from localhost ([127.0.0.1]:54121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea4KO-0007Vu-0D for submit@debbugs.gnu.org; Fri, 12 Jan 2018 13:45:20 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:48057) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea4KL-0007Vm-L4 for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 13:45:17 -0500 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 w0CIjGgZ020143; Fri, 12 Jan 2018 13:45:16 -0500 Received: by lechazo.home (Postfix, from userid 20848) id 721906030E; Fri, 12 Jan 2018 13:49:00 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> Date: Fri, 12 Jan 2018 13:49:00 -0500 In-Reply-To: <838td32afg.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jan 2018 20:34:27 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 3 Rules triggered GEN_SPAM_FEATRE=0.1, EDT_SA_DN_PASS=0, RV6199=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6199> : inlines <6310> : streams <1775865> : uri <2569028> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Please, not in *scratch*. Setting variables and then evaluating forms > that use them is very useful there. I'm not sure how the two sentences are connected: Setting lexical-binding to t in *scratch* won't prevent setting variables and evaluating forms that use them. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 13:56:12 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 18:56:12 +0000 Received: from localhost ([127.0.0.1]:54129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea4Uu-0007l1-9p for submit@debbugs.gnu.org; Fri, 12 Jan 2018 13:56:12 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea4Us-0007kp-Qo for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 13:56:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea4Uj-0002bo-TY for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 13:56:05 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea4Uj-0002bi-Qx; Fri, 12 Jan 2018 13:56:01 -0500 Received: from [176.228.60.248] (port=4254 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ea4Uj-0004lb-8d; Fri, 12 Jan 2018 13:56:01 -0500 Date: Fri, 12 Jan 2018 20:55:41 +0200 Message-Id: <83373a3o0i.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Fri, 12 Jan 2018 13:49:00 -0500) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Stefan Monnier > Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org > Date: Fri, 12 Jan 2018 13:49:00 -0500 > > > Please, not in *scratch*. Setting variables and then evaluating forms > > that use them is very useful there. > > I'm not sure how the two sentences are connected: > Setting lexical-binding to t in *scratch* won't prevent setting > variables and evaluating forms that use them. For some value of "prevent", surely? Dynamically-bound variables will no longer work as they did before, right? From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 14:03:00 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 19:03:00 +0000 Received: from localhost ([127.0.0.1]:54134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea4bU-0007vF-0b for submit@debbugs.gnu.org; Fri, 12 Jan 2018 14:03:00 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:52044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea4bS-0007v8-8m for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 14:02:58 -0500 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 w0CJ2vfH023387; Fri, 12 Jan 2018 14:02:57 -0500 Received: by lechazo.home (Postfix, from userid 20848) id 64973605FF; Fri, 12 Jan 2018 14:06:41 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> Date: Fri, 12 Jan 2018 14:06:41 -0500 In-Reply-To: <83373a3o0i.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jan 2018 20:55:41 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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, RV6199=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6199> : inlines <6310> : streams <1775866> : uri <2569040> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >> > Please, not in *scratch*. Setting variables and then evaluating forms >> > that use them is very useful there. >> I'm not sure how the two sentences are connected: >> Setting lexical-binding to t in *scratch* won't prevent setting >> variables and evaluating forms that use them. > For some value of "prevent", surely? Dynamically-bound variables will > no longer work as they did before, right? No, they'll work pretty much as before. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 14:35:58 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 19:35:58 +0000 Received: from localhost ([127.0.0.1]:54143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea57O-0000E0-Lu for submit@debbugs.gnu.org; Fri, 12 Jan 2018 14:35:58 -0500 Received: from mout.web.de ([212.227.15.3]:54648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea57M-0000Dm-HJ for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 14:35:57 -0500 Received: from drachen.dragon ([92.74.168.127]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MT8cQ-1eT1rb3GcA-00S3sQ; Fri, 12 Jan 2018 20:35:45 +0100 From: Michael Heerdegen To: Stefan Monnier Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <871sivf0tl.fsf@web.de> Date: Fri, 12 Jan 2018 20:35:44 +0100 In-Reply-To: (Stefan Monnier's message of "Fri, 12 Jan 2018 13:47:07 -0500") Message-ID: <87shbaeupb.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:ZA4mQdB1imkx2AO7GTYCMY+CXveOwzNihQfNCvNR8ejpw0JDpao xRN/kZpOSb4Me+uZSYth1xT5OTTWNlV8jaIHLFH0HPUCbMjUYOzVX2IEe1bzilz7rCnFyAo xdXw40iNieH03dcfSAmytcYWaXM/BF4X+bguKEvaC22GbO1vKOPT3c01cHityN+Wur/gQh9 yg3Z7C2GZ6P5yoFHtaUOQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:sSjVIvQfYDU=:29+gGpDZyMoFbPSTSSo6hT a7lpUR7MGp9czdK4Tje2K79i25/TkByY+J4c9S4gqTIwsoSdnRLeKSf9UKRJj4lNu/nfX68cz 4eI1T1q87qNf1Yf1TXGxMgSPWA8Q4KZgiMnPa7sQ0nuZKjqoJVzBiS9HGs/1vwsfvw+LaK8im mjiIyH+fNeDi46liqITaZOe4SXQH7D2T0FgCgpgdToMz8J3wqDwbeOM76NIbLGaB0A3O47RIm ZSyBZcjS/qJ2Ss/gCpsgBBQt1+y8pZcrUd6gDlgdst/WDG+7oV6Q4JrK6TAjv6M3VZANHsl1g kUmJKnVtqIocajNsy3SJyxpkow51JUl/ODHKqzjzQY8SRSM60G7xaOdRQ1Aqpx1m5WGYtJNh2 1G44/t9KIKYYmQM/mzWISie8zEjks7mxiGvcDayg8j+fEKjYBxJI3ifFW63xuLvJssu9knFUY 52h4owKZi/2EvYla0zdMboCJElKps3HrJ0ZaRZxsRoy6PFHISqJBq9DvUsQLIfdmB/5s0VQOn mdhRnK7DIiNvnaPw34giOlR6vQ4Wxbq7ghKYNAmhfrloEDTRcqPTOvdnmSMagcKOEt1iuULXd v+09eDyeSFHSPEtR3it7D4ZXKr2JatznLpDOupZwu6aKiAO5zh9K6LKdMEKGihIv2XCl2ivG2 1Y6umrK4zVB+8n8V0TBIEoJB8vjsXWZv/T63kptXeNeqSGWspKWsiWISfzB9j311WTgUlhdqm RacuA/wAaH5PidElNk+eSm3qoC0REpQBDl6Z+zfMtsailYfMe9P0qJidPh4aHzNNSl6wuegVl +DJ+v7+I1uZ+NNRNkKADB+caVF26LlqTQQ+1CgT2FaaFDmHLYw= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30078 Cc: 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stefan Monnier writes: > I'm not sure we should try to encourage the user to think a piece of > code can check the value of `lexical-binding` to know if it's being > evaluated using lexical scoping rules. I'm not sure, too. But aren't *scratch* and *ielm* special? These are the current buffers when code is evaluated, but they are also some kind of source-code buffer at the same time. In source code file buffers, M-x lexical-binding RET gives you the right answer about how the code in this buffers is interpreted. I think we should be careful - maybe new users are trying to learn Elisp with the help of *ielm*. With your patch, you get ELISP> (let ((x 1)) (lambda () x)) (closure ((x . 1) t) nil x) but if you put point after the input expression and hit C-x C-e you suddenly get (lambda nil x) People who are actually learning Elisp will not make any sense out of this, I think. Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 15:03:44 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 20:03:44 +0000 Received: from localhost ([127.0.0.1]:54151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea5YG-0000sI-2P for submit@debbugs.gnu.org; Fri, 12 Jan 2018 15:03:44 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea5YE-0000s6-Pm for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 15:03:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea5Y5-00086g-JB for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 15:03:37 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea5Y5-00086X-G4; Fri, 12 Jan 2018 15:03:33 -0500 Received: from [176.228.60.248] (port=4293 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ea5Y5-0006CS-0V; Fri, 12 Jan 2018 15:03:33 -0500 Date: Fri, 12 Jan 2018 22:03:13 +0200 Message-Id: <83zi5i26bi.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Fri, 12 Jan 2018 14:06:41 -0500) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Stefan Monnier > Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org > Date: Fri, 12 Jan 2018 14:06:41 -0500 > > >> > Please, not in *scratch*. Setting variables and then evaluating forms > >> > that use them is very useful there. > >> I'm not sure how the two sentences are connected: > >> Setting lexical-binding to t in *scratch* won't prevent setting > >> variables and evaluating forms that use them. > > For some value of "prevent", surely? Dynamically-bound variables will > > no longer work as they did before, right? > > No, they'll work pretty much as before. Then you are saying that turning on lexical-binding in *scratch* will change nothing at all? I very much doubt that, and my witness are all those packages that broke due to lexical-binding and needed minor fixes. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 15:33:35 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 20:33:36 +0000 Received: from localhost ([127.0.0.1]:54169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea619-0001Ym-LO for submit@debbugs.gnu.org; Fri, 12 Jan 2018 15:33:35 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:44001) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea615-0001YW-JO for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 15:33:31 -0500 Received: by mail-wm0-f42.google.com with SMTP id g1so14418452wmg.2 for <30078@debbugs.gnu.org>; Fri, 12 Jan 2018 12:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=BxlKFdqBk2/k1NBT4sY484WmxNdiRqdbXjhL+agbbl4=; b=NfIPmUQODu4UQIaws2IUCbo6W2KJGGtJKxJYa4pRSluCyH5LF42LvX8UVQ1/ogFol4 Y37i4q41fRjpEx4A49m3FSP/r6cAYnqg6YzIlAVoD81Xx2KJqwkl4bvQiiyqxhET35o1 EYBLLa7Ey73dFqNnnJeiMZFzRKTr1ca6pCQmOZl9U/I6DdVmH5HYB99Uozei9cC7bbFy w9IDU/FP5YunekSoIpiusPcf5Xdj5avxi1mDTYP/V9zUVLaR4BII+nrRH+XaLTayUcgj m2190prb3RfTnHWfhLlhfgLE+XdgM7we+UrOm6xMdW9vlMaHrLQ5iQwaZjNwW0LMXV1w Qu6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=BxlKFdqBk2/k1NBT4sY484WmxNdiRqdbXjhL+agbbl4=; b=Emi9qVM7JcIUI+pt5uuaJPV+LTlBO23VBstNHLD4M89v9TpqCVdNt0iWWkmEsatYgM tncM68BgmDW71mvxyrRosd+YNpLhKL2l3RBMLm68+oOQi0Ri1Nnf5blwRuTI4n2Q6C7w +UytuYQ7lop3odsBhduK2FxU2PNN7fwB6rtuJEGwGMevYXvyQZ41GopQA52gaggyao9r OPZZewH+84t0xoH2D+JjKTgowbF66rYaPQMwSWD6LxlZqksdNcajmzlZ8m3I5pqbgxrr hp02KAX3Hw5VVnre9vTA54y05p7eK1iZI00d/53rxPkrbxR+5ICTLaIrSsA57AF5plMX tXow== X-Gm-Message-State: AKwxytd4pgmtDBZL5zYH8sQgJySSpWfDIq9Xuwp/TC7buupunKUIAJfl fKFYkyQEeVXV5ozXWMDTCZ8cqSOFACR2tfGk50c= X-Google-Smtp-Source: ACJfBouao4veEMrQzcgTjs3e2qKW8XQRa8dFW7CxuYBUUXBrtvtmbzl7mvAygYsuLMyxHDWf8ggoXTXDTXedFUBvZbs= X-Received: by 10.28.35.200 with SMTP id j191mr5525468wmj.146.1515789205862; Fri, 12 Jan 2018 12:33:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.142.53 with HTTP; Fri, 12 Jan 2018 12:33:25 -0800 (PST) In-Reply-To: <83zi5i26bi.fsf@gnu.org> References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> From: Noam Postavsky Date: Fri, 12 Jan 2018 15:33:25 -0500 X-Google-Sender-Auth: TgH1c0MREIStovAUEUEHB0xgg6Y Message-ID: Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 30078 Cc: Michael Heerdegen , Stefan Monnier , 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On Fri, Jan 12, 2018 at 3:03 PM, Eli Zaretskii wrote: >> From: Stefan Monnier >> Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org >> Date: Fri, 12 Jan 2018 14:06:41 -0500 >> >> >> > Please, not in *scratch*. Setting variables and then evaluating forms >> >> > that use them is very useful there. >> >> I'm not sure how the two sentences are connected: >> >> Setting lexical-binding to t in *scratch* won't prevent setting >> >> variables and evaluating forms that use them. >> > For some value of "prevent", surely? Dynamically-bound variables will >> > no longer work as they did before, right? >> >> No, they'll work pretty much as before. > > Then you are saying that turning on lexical-binding in *scratch* will > change nothing at all? I very much doubt that, and my witness are all > those packages that broke due to lexical-binding and needed minor > fixes. Top-level `setq's would be unaffected (because the lexical environment at the top level is empty). Lexical binding only changes what `let' does, for undeclared variables. (okay, not *just* `let', it also affects `lambda') From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 15:55:40 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 20:55:41 +0000 Received: from localhost ([127.0.0.1]:54176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea6MV-00022c-HL for submit@debbugs.gnu.org; Fri, 12 Jan 2018 15:55:39 -0500 Received: from mout.web.de ([212.227.15.14]:65089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea6MU-00022Q-Iq for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 15:55:38 -0500 Received: from drachen.dragon ([92.74.168.127]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LtFVL-1eyl4W0QMl-012lEb; Fri, 12 Jan 2018 21:55:27 +0100 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> Date: Fri, 12 Jan 2018 21:55:25 +0100 In-Reply-To: <83zi5i26bi.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jan 2018 22:03:13 +0200") Message-ID: <87fu7aer0i.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:i/Kl4ifwXAeDwkPmWd+1TRnH6gxy/8fYQgQjMcRSqdaT9ZUwaGJ WxK0J+AmdjlyeRRkNsEdlCQ+mKY//CRvfqeRgou49pQ19knEBFosBRepmYGBwjvwicU6lm+ OhcolO7eaOVjy0TfsWUjvZbqJpztJdpLdI5ZqnW0fXnj/6moz6o2Wtg2aMhZq3OzGD/Whj/ UH8/VJ0P5lVIkUu2MwL/Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:fhs2jYnHbmA=:ontSCeNAzr4gqry0qr9dQt 9Q3faaV1BWIVnllpxMYN2+1SyCreGKy8Rnjo/u1OrR+Z7NECgfy8FAnEjuhSLWFUTsfvm3Wx6 f+t0GcN7ehNh4kDHJfGfdUImcoc3+uL92KH44+VpPonA44BYyfQ/DIrVvTJT/rFk7Gs9NR0FY iXvPzzQRWu062GctGbczOUzw9qXRRfo7xXC1ka9wOFwlBVhCnJY0GUgZqoQBInIDbtBGLMnm/ wJwrVO+CNBfGyJ5n9dYSftKelZiwa2zKSomgfhW+ZonIJ0dTnevDD1zqPxCicZE4IAAAN9XDp GZEe+PU86vUqpbO8C+JVi2y6nXPGSumSymn0RE5XOprYQuUKvYnZEptOYtsn04wZfmi7ubSmR Ze55cAWU7svVH+3Dxk8gBbi4i1/QsXc2wKj9IwkCWQX+elL2WFQqwowLELJSoWYqPl8dtCQHU 0V+FKth+b5HjmU1PUPolgubvzjXpQ1pHVkj5828caE1qFPzvFt8Qtmro5n/pG1q5kxdCP59hz 5yMPp2F0nZW3vWK5ppFkHcgv5gxm7MvSlh47k8JndzbxS+0UlUt3zq0tV9qpKjIk544xp+Zj6 3Vr5o81B6X+SNbfstCkLn27sVMaUdbauTx5Q6SA7tcSB/r76PozkpVdgnsSrkz6d3m6ZkMjgF FX/CrsqrDnR08a4CilXBzTudBeORpq9sZf1ttr96rNPjLK1Uo21yPdgTqsAHP90zkPq6J5SU9 hweksgGFEn7scJKtyOwNSsGUsCT2ly6OOOJkvXXhdq7YsA/j77mKUp6HF6PFQ7vgUJI2s/OHI wuqU6GjWxfOhgm/aahlLMXz25iB1hOK5zuihSPTWFflieS2FQY= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30078 Cc: Stefan Monnier , 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: > Then you are saying that turning on lexical-binding in *scratch* will > change nothing at all? I very much doubt that, and my witness are > all those packages that broke due to lexical-binding and needed minor > fixes. I do what has been proposed for months. I liked it. What are we doing with scratch? (1) Setting global variables, defining small functions and such simple stuff. lexical-binding doesn't make a big difference here. (2) Re-evaluate parts of the source code, often with small modifications, for testing and debugging. Since more and more packages make active use of lexical-binding, this is actually broken currently! Re-evaluating parts of source code in scratch can currently break Emacs. (3) I often posted some code examples in emacs-help which made use of lexical-binding. People pasted it into scratch and it didn't work. It's currently even not trivial to evaluate such examples with lexical-binding on. OTOH, there is not too much code that really relies on dynamical binding mode. And very often, such code is just written in a bad style (missing `defvar's etc.). In summary, I think the advantages clearly prevail. Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 16:05:28 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 21:05:28 +0000 Received: from localhost ([127.0.0.1]:54180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea6W0-0002Hl-L4 for submit@debbugs.gnu.org; Fri, 12 Jan 2018 16:05:28 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea6Vy-0002HV-Hw for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 16:05:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea6Vp-00020G-TZ for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 16:05:21 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:32936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea6Vp-0001zz-I7; Fri, 12 Jan 2018 16:05:17 -0500 Received: from [176.228.60.248] (port=4408 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ea6Vo-0004Yq-UB; Fri, 12 Jan 2018 16:05:17 -0500 Date: Fri, 12 Jan 2018 23:04:56 +0200 Message-Id: <83y3l223gn.fsf@gnu.org> From: Eli Zaretskii To: Michael Heerdegen In-reply-to: <87fu7aer0i.fsf@web.de> (message from Michael Heerdegen on Fri, 12 Jan 2018 21:55:25 +0100) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: monnier@IRO.UMontreal.CA, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Michael Heerdegen > Cc: Stefan Monnier , 30078@debbugs.gnu.org > Date: Fri, 12 Jan 2018 21:55:25 +0100 > > What are we doing with scratch? > > (1) Setting global variables, defining small functions and such simple > stuff. lexical-binding doesn't make a big difference here. We need to discuss the differences whether they are big or not. > (2) Re-evaluate parts of the source code, often with small > modifications, for testing and debugging. Since more and more packages > make active use of lexical-binding, this is actually broken currently! > Re-evaluating parts of source code in scratch can currently break Emacs. You are describing a mistake. People make mistakes all the time, and will continue making mistakes whatever we do. That shouldn't be a basis for our decisions. > (3) I often posted some code examples in emacs-help which made use of > lexical-binding. People pasted it into scratch and it didn't work. > It's currently even not trivial to evaluate such examples with > lexical-binding on. Another mistake. I don't see why this should be of any importance for the decision at hand. > OTOH, there is not too much code that really relies on dynamical binding > mode. And very often, such code is just written in a bad style (missing > `defvar's etc.). That's your opinion. I happen not to share it. > In summary, I think the advantages clearly prevail. I actually didn't yet see any advantages mentioned, and the above aren't, IMO. Lexical-binding is just a feature, albeit an important one. It doesn't have to be introduced into every possible corner of Emacs, not without a good reason. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 16:11:34 2018 Received: (at 30078) by debbugs.gnu.org; 12 Jan 2018 21:11:34 +0000 Received: from localhost ([127.0.0.1]:54184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea6bu-0002Q9-BU for submit@debbugs.gnu.org; Fri, 12 Jan 2018 16:11:34 -0500 Received: from mout.web.de ([217.72.192.78]:53272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea6br-0002Pw-Ap for 30078@debbugs.gnu.org; Fri, 12 Jan 2018 16:11:31 -0500 Received: from drachen.dragon ([92.74.168.127]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MQ6PP-1eW08G3bpz-005L1G; Fri, 12 Jan 2018 22:11:16 +0100 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> Date: Fri, 12 Jan 2018 22:11:14 +0100 In-Reply-To: <83y3l223gn.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jan 2018 23:04:56 +0200") Message-ID: <87bmhyeqa5.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:S3oE9sl3ZNaHXYT3JPmWE1xdW+x3TPu6ziAjP9NGNmf0OrG4aLe ZUuHU9lLuAkoCJ9oeLlJKcmaIOMz3DH3uJ90ckSr2M6IlHtzohPRZTIhrOVhpfYIMiCnOiH adgjNAI0F4MbqerlrayhXRkOs09Zjn5nBOLQrzsXMR5HuGc6qbT6WjPQSEbxrdTrmcDdN0K KVXqgmH59Scn/btPxD2oA== X-UI-Out-Filterresults: notjunk:1;V01:K0:cXRIzudxYxs=:TR0vlcDK3YMgRHOOL0enah scuj/K9fMNvuJmRtlARBM3tdmP8Hx5m61+py3YO2pLI2HK7iVaT1YTU9d413F4HbFDwxjNl30 3eATozJG89otfvTbXpUlVoP5m0iLbI/5JpYCa8J+DXFmQga7ktpbn9ZLXJimBNJq1+D2TOm0b a3qXQ8yqLQiaYoXxovWtzCDfDYagIeLlFjRnJI6Cb/0EcigPIpY76DzjZnhPkrD71vEbmhGyc iRjMK46pk47czVV3Ofyg1D8lZStqTTqU866SoAPf1VzPTD1iv/3o8bRiYlcFgTuOUo4R4okc+ GScKrpEeoynjJ7H8/w8blAEiutd+NcOjXUAQ2N1lZ6WPFcjahuKGrzNWTlt6RCCli76v2kP2i LD4byk2zNpFT14p2d6bOg+rCa0nIIOJrOM/V/m/biyY0oi3KXXSl5zyEDvTGH1rUx3kuqWK0n JE6akJkR3bOdGjoNTJjC0c6aCOHseThJkKCQCagChfTyFkKugnqdUZSfvk6ebvQ1w2MJiPQj7 ond7wgki/5I7WOZSi82PkLMMINT9JNjAmcK/5Cx4oZhFBd/nWrmXV2ktZxAQ6PM6TNSxu7R/K 0+DlFpA2nxYsdhhE7EXsfcyVB54vUxMiMCLCmIsFKfDirvusPDz3+BXPKJIMovAYh62u14uEo 31O0r8g8zQQEvC2GV7JBA8iZhoBAboSR7HPY9ch8ZTegIZESV8uHuYQrooiRH7Dm/Y2wVAv/z G60/CT+LVp9scMNJVmtSh0H6An9XQ7LcWmcyLNxVssxpglkGhYm4vs3UQkTdgTFDNkIGC74BU dj5SCN4/SSXtRML22IzT31wr9HLIjcdWoYLfZ2ed5Ny9QLGqKM= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30078 Cc: monnier@IRO.UMontreal.CA, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: > I actually didn't yet see any advantages mentioned, and the above > aren't, IMO. Lexical-binding is just a feature, albeit an important > one. It doesn't have to be introduced into every possible corner of > Emacs, not without a good reason. Ah, so you doubt that lexical-binding once should just be the default. Then I think we should discuss about this goal. Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 12:50:43 2018 Received: (at 30078) by debbugs.gnu.org; 13 Jan 2018 17:50:43 +0000 Received: from localhost ([127.0.0.1]:55075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaPx4-0002iM-SX for submit@debbugs.gnu.org; Sat, 13 Jan 2018 12:50:43 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:50849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaPx2-0002iC-NG for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 12:50:41 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1FF4120CF4; Sat, 13 Jan 2018 12:50:40 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Sat, 13 Jan 2018 12:50:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luisgerhorst.de; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=ZGptdPyVHh2vFo XzM3MrgS3AGmrUYXUo6+uHubfcFrU=; b=imyXh6rbBRDngUjMKrJz6WYqASHHpY ZVbDNf3OM5dBo+OdpHhROlXwAh2na98uulCKW+e6M3oUPCrDWZWAJM8ix3gFCehv /RRjPTS6PIt55fMeEqXeFOMhmxu3QrtqXPTpHbS6k22sE9l5hs0ZLOZlAbgrlzA8 4JdBPQplxnkng= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=ZGptdP yVHh2vFoXzM3MrgS3AGmrUYXUo6+uHubfcFrU=; b=HCr+SEe/YuVpaBtkjgRLFP ympNtwaKbYpGgJVTh5DjdccqbYZCPZRXGfs+G6/eymFAOMlUFwYeArn8VKgDw7ws M07VXKjzkw7VTxfJ91sPLlb0Z5/rVFoV8fTEnLou5MfP6IyQUfHd0ohxgBw+6IpZ aRxu5S0CMvs5NW/4gToR7vfx19S0BpLncfwxvgUhbOf8FCrr13wAf61Cb2Sjqnlw oiJpRnI2E2Xt/31Io0sAbX641e6GTwYkPb8gpjLvMHJQRgs5h5DBHhAihU23s+hN jdB6gHJ7RSFhYWybQIq/sm5sjIOc13Pj2Tlun6iBzWMQJ1pu4hQYE3LkoM+ILdQw == X-ME-Sender: Received: from [192.168.178.98] (p4ffa8e15.dip0.t-ipconnect.de [79.250.142.21]) by mail.messagingengine.com (Postfix) with ESMTPA id 8BFBA24801; Sat, 13 Jan 2018 12:50:39 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: From: Luis Gerhorst X-Mailer: iPhone Mail (15C153) In-Reply-To: <87bmhyeqa5.fsf@web.de> Date: Sat, 13 Jan 2018 18:50:36 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> <87bmhyeqa5.fsf@web.de> To: Michael Heerdegen X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30078 Cc: Eli Zaretskii , monnier@IRO.UMontreal.CA, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > On 12. Jan 2018, at 22:11, Michael Heerdegen wr= ote: >=20 > Ah, so you doubt that lexical-binding once should just be the default. > Then I think we should discuss about this goal. Here are a few possible pros of lexical binding: 1) Make Elisp more approachable to newcomers. Lexical binding is the default= in most programming languages and thus more people are familiar with it. Th= is makes it easier for people to understand existing code since they don=E2=80= =98t have to get used to implicit dynamic binding first, which the code may t= ake advantage of. 2) Make existing code more maintainable. I was involved in porting the packa= ge emacs-eclim to lexical binding. The process shed light on some very dark p= arts of the codebase nobody had touched in a while since they were written i= n very bad style and thus hard to understand. Using lexical binding forced u= s to simplify those parts. 3) This is a minor one: I=E2=80=98ve heard that lexical binding allows for m= ore optimizations. I don=E2=80=98t know to which extend this actually happen= s and whether it is noticeable to the user. I believe 1) and 2) will significantly help improving the general quality of= Elisp code and thus of Emacs in general. Here=E2=80=98s the big con: If lexical binding should become the default one day, you would have to give= everyone a reasonable amount of time (multiple years?) to adapt for it and p= ort their code or set lexical binding to nil in their files. One idea would be to make elisp-mode somehow encourage users to enable lexic= al binding in the files they are editing. Any ideas how this can be done wit= hout annoying users? Ideas: - Prompting every time elisp-mode is enabled in a file that does not have a l= exical binding header. - I know that certain functions insert a apropriate copyright notice into el= -files, do / can those also set lexical binding to t? Best regards, Luis= From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 12:58:20 2018 Received: (at 30078) by debbugs.gnu.org; 13 Jan 2018 17:58:20 +0000 Received: from localhost ([127.0.0.1]:55079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaQ4S-0002sk-ML for submit@debbugs.gnu.org; Sat, 13 Jan 2018 12:58:20 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:38619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaQ4P-0002sa-MR for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 12:58:19 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0DHwGTT019701; Sat, 13 Jan 2018 12:58:16 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 0E5B36629F; Sat, 13 Jan 2018 12:58:16 -0500 (EST) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> <871sivf0tl.fsf@web.de> <87shbaeupb.fsf@web.de> Date: Sat, 13 Jan 2018 12:58:16 -0500 In-Reply-To: <87shbaeupb.fsf@web.de> (Michael Heerdegen's message of "Fri, 12 Jan 2018 20:35:44 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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, RV6199=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6199> : inlines <6310> : streams <1775957> : uri <2569765> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >> I'm not sure we should try to encourage the user to think a piece of >> code can check the value of `lexical-binding` to know if it's being >> evaluated using lexical scoping rules. > I'm not sure, too. But aren't *scratch* and *ielm* special? These are > the current buffers when code is evaluated, For *scratch* yes, but for *ielm* that's not the case: the code is evaluated in the `ielm-working-buffer` (whose name normally appears in the mode-line after "IELM"). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 13:06:03 2018 Received: (at 30078) by debbugs.gnu.org; 13 Jan 2018 18:06:04 +0000 Received: from localhost ([127.0.0.1]:55088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaQBv-00034x-P9 for submit@debbugs.gnu.org; Sat, 13 Jan 2018 13:06:03 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:38848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaQBt-00034X-2d for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 13:06:01 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0DI5wfO020076; Sat, 13 Jan 2018 13:05:58 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 10A126629F; Sat, 13 Jan 2018 13:05:58 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> Date: Sat, 13 Jan 2018 13:05:58 -0500 In-Reply-To: <83zi5i26bi.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jan 2018 22:03:13 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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, RV6199=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6199> : inlines <6310> : streams <1775958> : uri <2569769> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >> No, they'll work pretty much as before. > Then you are saying that turning on lexical-binding in *scratch* will > change nothing at all? Not nothing at all, but the two languages are *very* similar and the differences rarely show up in a single expression. My gut feeling is that the main risk to bump into an undesirable behavior is something like (let ((foopkg-var t)) (foopkg-fun arg1 arg2)) where foopkg is not yet loaded and foopkg-fun is autoloaded: Emacs will only be told that `foopkg-var` is a dynamic-variable once the `foopkg-fun` call causes `foopkg` to be loaded, so Emacs will mistakenly use lexical scoping for the let binding because at that it still knows nothing about `foopkg-var`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 13:19:56 2018 Received: (at 30078) by debbugs.gnu.org; 13 Jan 2018 18:19:56 +0000 Received: from localhost ([127.0.0.1]:55121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaQPM-0003QL-9m for submit@debbugs.gnu.org; Sat, 13 Jan 2018 13:19:56 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:39182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaQPK-0003QE-UG for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 13:19:55 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0DIJr3V020559; Sat, 13 Jan 2018 13:19:53 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 04D5D6629F; Sat, 13 Jan 2018 13:19:53 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> Date: Sat, 13 Jan 2018 13:19:52 -0500 In-Reply-To: <83y3l223gn.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jan 2018 23:04:56 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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, RV6199=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6199> : inlines <6310> : streams <1775959> : uri <2569774> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: Michael Heerdegen , 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Lexical-binding is just a feature, albeit an important one. > It doesn't have to be introduced into every possible corner of Emacs, > not without a good reason. lexbind-Elisp and dynbind-Elisp are fundamentally two different languages. They are so similar that we don't think of it in those terms, but having those 2 introduces complexity (including for the users occasionally). And actually the fact they're so similar sometimes makes the problem worse because most people don't realize that they have to pay attention to it or how to know which language is used when. 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. bug#30078 is about making another step in this direction. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 14:34:51 2018 Received: (at 30078) by debbugs.gnu.org; 13 Jan 2018 19:34:51 +0000 Received: from localhost ([127.0.0.1]:55136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaRZr-00058L-4y for submit@debbugs.gnu.org; Sat, 13 Jan 2018 14:34:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53391) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaRZp-000588-JH for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 14:34:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaRZf-0004er-Ow for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 14:34:44 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaRZf-0004el-Lu; Sat, 13 Jan 2018 14:34:39 -0500 Received: from [176.228.60.248] (port=1904 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eaRZd-0003Lc-Qn; Sat, 13 Jan 2018 14:34:39 -0500 Date: Sat, 13 Jan 2018 21:34:10 +0200 Message-Id: <83bmhx1rkd.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Sat, 13 Jan 2018 13:19:52 -0500) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Stefan Monnier > Cc: Michael Heerdegen , 30078@debbugs.gnu.org > Date: Sat, 13 Jan 2018 13:19:52 -0500 > > 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. 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. My comments in this thread are largely because I feel uneasy about this undeclared policy for quite some time. For the record, I have nothing against making lexical-binding the default, if that's what everybody wants. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 14:37:47 2018 Received: (at 30078) by debbugs.gnu.org; 13 Jan 2018 19:37:47 +0000 Received: from localhost ([127.0.0.1]:55140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaRch-0005CZ-Jk for submit@debbugs.gnu.org; Sat, 13 Jan 2018 14:37:47 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaRcg-0005CL-9w for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 14:37:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaRcW-0006xK-HR for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 14:37:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaRcW-0006xB-D6; Sat, 13 Jan 2018 14:37:36 -0500 Received: from [176.228.60.248] (port=1912 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eaRcU-00006P-Gj; Sat, 13 Jan 2018 14:37:36 -0500 Date: Sat, 13 Jan 2018 21:37:09 +0200 Message-Id: <83a7xh1rfe.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Sat, 13 Jan 2018 13:05:58 -0500) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Stefan Monnier > Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org > Date: Sat, 13 Jan 2018 13:05:58 -0500 > > (let ((foopkg-var t)) > (foopkg-fun arg1 arg2)) > > where foopkg is not yet loaded and foopkg-fun is autoloaded: Emacs will > only be told that `foopkg-var` is a dynamic-variable once the > `foopkg-fun` call causes `foopkg` to be loaded, so Emacs will mistakenly > use lexical scoping for the let binding because at that it still knows > nothing about `foopkg-var`. That indeed could be a confusing situation, perhaps we should have a special form for it, to avoid the confusing/incorrect/unexpected results. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 14:49:18 2018 Received: (at 30078) by debbugs.gnu.org; 13 Jan 2018 19:49:18 +0000 Received: from localhost ([127.0.0.1]:55144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaRnp-0005Si-O3 for submit@debbugs.gnu.org; Sat, 13 Jan 2018 14:49:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaRnn-0005SU-68 for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 14:49:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaRne-0001EM-4C for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 14:49:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaRne-0001EI-0j; Sat, 13 Jan 2018 14:49:06 -0500 Received: from [176.228.60.248] (port=1921 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eaRnc-0002tl-Bq; Sat, 13 Jan 2018 14:49:05 -0500 Date: Sat, 13 Jan 2018 21:48:38 +0200 Message-Id: <837esl1qw9.fsf@gnu.org> From: Eli Zaretskii To: Luis Gerhorst In-reply-to: (message from Luis Gerhorst on Sat, 13 Jan 2018 18:50:36 +0100) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> <87bmhyeqa5.fsf@web.de> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, monnier@IRO.UMontreal.CA, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Luis Gerhorst > Date: Sat, 13 Jan 2018 18:50:36 +0100 > Cc: Eli Zaretskii , monnier@IRO.UMontreal.CA, > 30078@debbugs.gnu.org > > 1) Make Elisp more approachable to newcomers. Lexical binding is the default in most programming languages and thus more people are familiar with it. This makes it easier for people to understand existing code since they don‘t have to get used to implicit dynamic binding first, which the code may take advantage of. 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 15:19:48 2018 Received: (at 30078) by debbugs.gnu.org; 13 Jan 2018 20:19:48 +0000 Received: from localhost ([127.0.0.1]:55155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaSHM-0006EC-Ga for submit@debbugs.gnu.org; Sat, 13 Jan 2018 15:19:48 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:37089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaSHJ-0006Dz-Az for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 15:19:46 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9FAE520D61; Sat, 13 Jan 2018 15:19:44 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Sat, 13 Jan 2018 15:19:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luisgerhorst.de; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=tBxpLcwfdL8w1Rb+VpYJtJTn2GrFJeEZXxbVviiutNc=; b=f7qf2 AdI7KADVC1UVy5hqW6TWS1HWhA7IN/yC2R8xIQTA0zazd4SDKuKb3TuOUM/AtwdH PSzOJgtx/c4W0Y0mGWdRqQ/G1VBDSt7J3T/nL2RVZve+KSXYUHIhq1d85LcY4z85 alOSivRIVNEh++LEywxD12OLEeVrRilKy6gC44= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=tBxpLcwfdL8w1Rb+VpYJtJTn2GrFJ eEZXxbVviiutNc=; b=kFEYi4U8OeOs8MSoL7Ydx81KWdQj65QGvr5E5jPoDbA19 M85KcVtkeli/WTUGkq+Sb7pKxtTkUQfV7zsgYbn5QO6/hIz+3UXXKsVIbWeA7rur SOzmI700EOgRmoSFQSLK1GaYRALn5cXc8du2ohA09wrB2VMWFuKB2IGUG8H/WVkz S2hPEtiqAakmTDXrO0P4B1SvmJml4djhKWnbZNUpFwOS3j2veWAAFRO7omKVqrjs uFMoyncBiFdz4AAzMy6HXCsMqPiiPY90UowCdX84cUMz4POMUY7+CLzGat+Z7+Pn BK4+OQPs4+lxsUmHEdXGk4EROogdyVaBkeGryW61A== X-ME-Sender: Received: from luis-imac.fritz.box (p4ffa8e15.dip0.t-ipconnect.de [79.250.142.21]) by mail.messagingengine.com (Postfix) with ESMTPA id C26657E335; Sat, 13 Jan 2018 15:19:43 -0500 (EST) References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> <87bmhyeqa5.fsf@web.de> <837esl1qw9.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.3.1 From: Luis Gerhorst To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: In-reply-to: <837esl1qw9.fsf@gnu.org> Date: Sat, 13 Jan 2018 21:19:40 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, monnier@IRO.UMontreal.CA, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: > 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. I wouldn't say we know it for a fact, but I would say we can be pretty sure about it. I think nobody would deny that imperative languages, which mostly use lexical binding, are much more popular (e.g. google the 10 most popular programming languages). You may argue that Emacs users have another background but if you go to https://github.com/topics/emacs and look at the contributors of an arbitrary project you can be almost certain they have at least one imperative language in ther portfolio (most I've looked at only have imperative languages and Emacs Lisp projects). From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 16:58:05 2018 Received: (at 30078) by debbugs.gnu.org; 13 Jan 2018 21:58:05 +0000 Received: from localhost ([127.0.0.1]:55196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaToT-0000Ti-Jc for submit@debbugs.gnu.org; Sat, 13 Jan 2018 16:58:05 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:51904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaToQ-0000TX-RF for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 16:58:03 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0DLw13X001261; Sat, 13 Jan 2018 16:58:01 -0500 Received: by pastel.home (Postfix, from userid 20848) id 49F936080A; Sat, 13 Jan 2018 16:58:00 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> <83bmhx1rkd.fsf@gnu.org> Date: Sat, 13 Jan 2018 16:58:00 -0500 In-Reply-To: <83bmhx1rkd.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Jan 2018 21:34:10 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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, RV6199=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6199> : inlines <6310> : streams <1775973> : uri <2569894> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > 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. Of course. > 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. That's what I think I'm doing. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 18:18:25 2018 Received: (at 30078) by debbugs.gnu.org; 13 Jan 2018 23:18:25 +0000 Received: from localhost ([127.0.0.1]:55219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaV4D-0002TA-GT for submit@debbugs.gnu.org; Sat, 13 Jan 2018 18:18:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaV4C-0002Sx-4q for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 18:18:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaV45-0006bf-Ne for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 18:18:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaV3z-0006Ve-Q0; Sat, 13 Jan 2018 18:18:11 -0500 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1eaV3z-0000Eb-8b; Sat, 13 Jan 2018 18:18:11 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Sat, 13 Jan 2018 13:19:52 -0500) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> Message-Id: Date: Sat, 13 Jan 2018 18:18:11 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, eliz@gnu.org, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) [[[ 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. ]]] We could introduce a warning for any Lisp file that fails to specify lexical vs dynamic. After a few years, we could assume that all files specify it, so we could change the default. -- Dr Richard Stallman President, Free Software Foundation (https://gnu.org, https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) Skype: No way! See https://stallman.org/skype.html. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 21:07:27 2018 Received: (at 30078) by debbugs.gnu.org; 14 Jan 2018 02:07:27 +0000 Received: from localhost ([127.0.0.1]:55259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaXhn-0006MR-1Z for submit@debbugs.gnu.org; Sat, 13 Jan 2018 21:07:27 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:60670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaXhk-0006MD-Ns for 30078@debbugs.gnu.org; Sat, 13 Jan 2018 21:07:25 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0E26lJa002781; Sun, 14 Jan 2018 02:07:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=c4EM1pEDFNBaJ7Pqw69hYK5M/YmOMHPOTk9wNZ0zqBE=; b=p0RQEU/2qZn/vFbNJu5Mn/ywz/ZoCl9ZJaGqRyI9QX+CWQL3QKw7NgyolNOpKMyz55yj Zbp3VBIwVygLF3u5DeJVT5YEzHV+Vf/ZFuz446nQqsO9MpRd/ZJE+bOEwLXA70hszam1 uTZJlDpseCqKaiLZgJ029W9h4oHj6SjDj1FF8kcPlM9zDyWG7nogoleneNZ4LM3uv1is LIpgi5+xvgMWyNXjgtnQ6m5JZVCjh2Lw3Nus8O/de+wpptVhsn9Ghvw9jdtTDEsIZNNf HIJXdAInLNAsBktHbYVuyYQSVa0KrsV6F9foo1cX0tPkshiquwAOajGAYaLyOMBeBiP3 Iw== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2ffx3x803e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 14 Jan 2018 02:07:18 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0E27HD7002166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 14 Jan 2018 02:07:17 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0E27FGq026457; Sun, 14 Jan 2018 02:07:15 GMT MIME-Version: 1.0 Message-ID: Date: Sat, 13 Jan 2018 18:07:13 -0800 (PST) From: Drew Adams To: Stefan Monnier , Eli Zaretskii Subject: RE: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4627.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8773 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=2 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=2 mlxscore=2 mlxlogscore=160 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801140026 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30078 Cc: Michael Heerdegen , 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > lexbind-Elisp and dynbind-Elisp are fundamentally two different > languages. If you want to argue that then Lisp itself is fundamentally several languages. (Yes, even Lisp 1.5, sans CLOS and all the rest.) Nothing says that a single language cannot "fundamentally" have more than one kind of binding/scoping. > They are so similar that we don't think of it in those > terms, but having those 2 introduces complexity (including for the users > occasionally). And actually the fact they're so similar sometimes makes > the problem worse because most people don't realize that they have to > pay attention to it or how to know which language is used when. There are plenty of things that one needs to pay attention to in Lisp. List-structure, for one. Lisp is not Haskell. Yes, Lisp can be complex, for both users and implementors. > 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. I very much hope _not_. Lexical and dynamic binding each have their place in Lisp, especially in Emacs Lisp. RMS underlined the importance of dynamic binding for Emacs. That argument remains as potent and relevant today as when he wrote it. http://www.gnu.org/software/emacs/emacs-paper.html#SEC18 Lexical and dynamic binding have coexisted fine in Common Lisp for almost 40 years now. And lexical binding is the default in Common Lisp. That would be fine for Emacs Lisp too someday. I have no objection to a move toward that, in principle. It was a definite plus to add lexical binding to Emacs. Thank you very much for that. Bravo. (And a vacuous `defvar' is not a bad way to declare a special/dynamic variable.) On the other hand, it would be a definite impairment to remove dynamic binding from Emacs Lisp. No thank you. > bug#30078 is about making another step in this direction. If that's all bug#30078 is about then don't do it. (But I hope that's not all it's about.) From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 14 00:59:04 2018 Received: (at 30078) by debbugs.gnu.org; 14 Jan 2018 05:59:04 +0000 Received: from localhost ([127.0.0.1]:55332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eabJw-0003Nh-50 for submit@debbugs.gnu.org; Sun, 14 Jan 2018 00:59:04 -0500 Received: from vps28183.inmotionhosting.com ([23.235.221.66]:55659) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eabJt-0003ND-RV for 30078@debbugs.gnu.org; Sun, 14 Jan 2018 00:59:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cochranmail.com; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8mL+K+g3yahT7CAZynylyupiXbaTIuPo5JZQu7dx9RE=; b=W6vz1ZgcTKMT+H0F2dlhISDp6M 8x0UccnFvYYC+UFCTmkuSwtqvdCe4JtSA+RfGfyXoSoTQFddH0vA3DQQP3XbDcs5hjmyKTmYxf3Xy usj7+T8XTJ/iFdtrftVGsarAkTpYoaaM/1oEs3KMkpvGHY8tiF2JyhBm2rBaApvDnRSZ0pfZepPmK tqNJfADKOnScFwRYm3muOO1TWkzr//DmZx6qohk+Mo9aHNGhWh29rNOfpzDO/0fHOWmtcBicOp26r /SMryd3g5ghVqXWucNZI7fdiNpJNlB0DBcOPbdHX8vfh4ZungVV1R0ReZUSj3kZXowzHcTL260udu RfmtpBrg==; Received: from 131-191-86-130.as.clicknet.org ([131.191.86.130]:36614 helo=SoraLaptop) by vps28183.inmotionhosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1eabJm-0003Jw-4a; Sat, 13 Jan 2018 21:58:54 -0800 From: Robert Cochran To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> <87bmhyeqa5.fsf@web.de> <837esl1qw9.fsf@gnu.org> Date: Sat, 13 Jan 2018 21:58:48 -0800 In-Reply-To: <837esl1qw9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Jan 2018 21:48:38 +0200") Message-ID: <87shb9ouav.fsf@cochranmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps28183.inmotionhosting.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - cochranmail.com X-Get-Message-Sender-Via: vps28183.inmotionhosting.com: authenticated_id: robert@cochranmail.com X-Authenticated-Sender: vps28183.inmotionhosting.com: robert@cochranmail.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, monnier@IRO.UMontreal.CA, Luis Gerhorst , 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: >> From: Luis Gerhorst >> Date: Sat, 13 Jan 2018 18:50:36 +0100 >> Cc: Eli Zaretskii , monnier@IRO.UMontreal.CA, >> 30078@debbugs.gnu.org >>=20 >> 1) Make Elisp more approachable to newcomers. Lexical binding is the def= ault >> in most programming languages and thus more people are familiar with it.= This >> makes it easier for people to understand existing code since they don=E2= =80=98t have >> to get used to implicit dynamic binding first, which the code may take >> advantage of. > > 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. I learned Emacs Lisp by learning Common Lisp first when I set out to learn it. Prior to that, I had been programming in languages that have lexical scoping as the primary scope mechanism. I personally do not know of non-Lisp languages that have variables that work like dynamic variables do. And of course I can't comment from the perspective from a newcommer any more, but I'd be of the mind that entirely dynamic binding would be /less/ easy to grasp, because it does things that I personally find non-intuitive in certain circumstances. I have programmer friends that use Emacs but don't do their own Emacs Lisp, and I would hazard a guess that dynamic bindings would be unintuitive when they differ from lexical bindings in behavior. IMO, the fact that dynamic bindings happen to do the same thing as lexical bindings is the reason the whole thing isn't nearly as confusing as it could be. That's not to say that dynamic bindings are bad - far from it. Dynamic bindings are really useful. But I think that the potentially confusing behavior should be opt-in, not opt-out. --=20 ~Robert Cochran GPG Fingerprint - BD0C 5F8B 381C 64F0 F3CE E7B9 EC9A 872C 41B2 77C2 From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 14 21:35:18 2018 Received: (at 30078) by debbugs.gnu.org; 15 Jan 2018 02:35:18 +0000 Received: from localhost ([127.0.0.1]:56543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaucH-00049M-Qv for submit@debbugs.gnu.org; Sun, 14 Jan 2018 21:35:18 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaucG-00049A-4G for 30078@debbugs.gnu.org; Sun, 14 Jan 2018 21:35:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eauc9-0002Rr-J7 for 30078@debbugs.gnu.org; Sun, 14 Jan 2018 21:35:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaubv-00027l-6C; Sun, 14 Jan 2018 21:34:55 -0500 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1eaubu-000309-Kq; Sun, 14 Jan 2018 21:34:54 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Drew Adams In-reply-to: (message from Drew Adams on Sat, 13 Jan 2018 18:07:13 -0800 (PST)) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <838td32afg.fsf@gnu.org> <83373a3o0i.fsf@gnu.org> <83zi5i26bi.fsf@gnu.org> <87fu7aer0i.fsf@web.de> <83y3l223gn.fsf@gnu.org> Message-Id: Date: Sun, 14 Jan 2018 21:34:54 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, eliz@gnu.org, monnier@IRO.UMontreal.CA, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) [[[ 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. ]]] > Lexical and dynamic binding each have their place in Lisp, > especially in Emacs Lisp. RMS underlined the importance > of dynamic binding for Emacs. Emacs must have dynamic binding, but that doesn't mean it needs to have a mode where dynamic binding is the default. It can be limited to the variables declared to be dynamic. -- Dr Richard Stallman President, Free Software Foundation (https://gnu.org, https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) Skype: No way! See https://stallman.org/skype.html. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 19 15:32:27 2018 Received: (at 30078) by debbugs.gnu.org; 19 Mar 2018 19:32:27 +0000 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 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 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 Received: by lechazo.home (Postfix, from userid 20848) id 125B0632A7; Mon, 19 Mar 2018 15:32:24 -0400 (EDT) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> Date: Mon, 19 Mar 2018 15:32:23 -0400 In-Reply-To: (Stefan Monnier's message of "Fri, 12 Jan 2018 11:12:23 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 19 15:34:58 2018 Received: (at 30078) by debbugs.gnu.org; 19 Mar 2018 19:34:58 +0000 Received: from localhost ([127.0.0.1]:42185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ey0Yc-0001IU-6Q for submit@debbugs.gnu.org; Mon, 19 Mar 2018 15:34:58 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:36920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ey0Ya-0001IM-8G for 30078@debbugs.gnu.org; Mon, 19 Mar 2018 15:34:56 -0400 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 w2JJYtGI018679; Mon, 19 Mar 2018 15:34:55 -0400 Received: by lechazo.home (Postfix, from userid 20848) id 5439B632A7; Mon, 19 Mar 2018 15:34:55 -0400 (EDT) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> Date: Mon, 19 Mar 2018 15:34:55 -0400 In-Reply-To: (Stefan Monnier's message of "Mon, 19 Mar 2018 15:32:23 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 <2611204> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > New patch below. Of course, I got side-tracked and forgot to include the patch. Here it is, Stefan diff --git a/etc/NEWS b/etc/NEWS index 99f3f27486..2d985aab9e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -71,6 +71,10 @@ moved to the early init file (see above). * Changes in Emacs 27.1 +** Lexical binding is now used when evaluating interactive Elisp forms +More specifically, lexical-binding is now used for M-:, --eval, as well +as in the *scratch* and *ielm* buffers. + --- ** The new option 'tooltip-resize-echo-area' avoids truncating tooltip text on GUI frames when tooltips are displayed in the echo area. Instead, diff --git a/lisp/ielm.el b/lisp/ielm.el index 59e333f19c..73cf37efbc 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -559,10 +559,11 @@ inferior-emacs-lisp-mode ;; Useful for `hs-minor-mode'. (setq-local comment-start ";") (setq-local comment-use-syntax t) + (setq-local lexical-binding t) - (set (make-local-variable 'indent-line-function) 'ielm-indent-line) + (set (make-local-variable 'indent-line-function) #'ielm-indent-line) (set (make-local-variable 'ielm-working-buffer) (current-buffer)) - (set (make-local-variable 'fill-paragraph-function) 'lisp-fill-paragraph) + (set (make-local-variable 'fill-paragraph-function) #'lisp-fill-paragraph) ;; Value holders (set (make-local-variable '*) nil) diff --git a/lisp/server.el b/lisp/server.el index ff03cbe622..a8a82922f5 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -793,7 +793,7 @@ server-eval-and-print ;; intended it to interrupt us rather than interrupt whatever Emacs ;; was doing before it started handling the process filter. ;; Hence `with-local-quit' (bug#6585). - (let ((v (with-local-quit (eval (car (read-from-string expr)))))) + (let ((v (with-local-quit (eval (car (read-from-string expr)) t)))) (when proc (with-temp-buffer (let ((standard-output (current-buffer))) @@ -1315,7 +1315,7 @@ server-execute (find-file-noselect initial-buffer-choice)) ((functionp initial-buffer-choice) (funcall initial-buffer-choice))))) - (if (buffer-live-p buf) buf (get-buffer-create "*scratch*"))))) + (if (buffer-live-p buf) buf (startup--get-buffer-create-scratch))))) ;; Set current buffer so that newly created tty frames ;; show the correct buffer initially. (frame (with-current-buffer (or (car buffers) diff --git a/lisp/simple.el b/lisp/simple.el index fa93cf87c7..f578efb7cb 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1579,12 +1579,12 @@ eval-expression (eval-expression-get-print-arguments current-prefix-arg))) (if (null eval-expression-debug-on-error) - (push (eval exp lexical-binding) values) + (push (eval exp t) values) (let ((old-value (make-symbol "t")) new-value) ;; Bind debug-on-error to something unique so that we can ;; detect when evalled code changes it. (let ((debug-on-error old-value)) - (push (eval (macroexpand-all exp) lexical-binding) values) + (push (eval (macroexpand-all exp) t) values) (setq new-value debug-on-error)) ;; If evalled code has changed the value of debug-on-error, ;; propagate that change to the global binding. diff --git a/lisp/startup.el b/lisp/startup.el index 2669342eda..77d6232924 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1357,7 +1357,8 @@ command-line (if (get-buffer "*scratch*") (with-current-buffer "*scratch*" (if (eq major-mode 'fundamental-mode) - (funcall initial-major-mode)))) + (funcall initial-major-mode)) + (setq-local lexical-binding t))) ;; Load library for our terminal type. ;; User init file can set term-file-prefix to nil to prevent this. @@ -2103,7 +2104,7 @@ normal-no-mouse-startup-screen (insert "\t\t") (insert-button "Open *scratch* buffer" 'action (lambda (_button) (switch-to-buffer - (get-buffer-create "*scratch*"))) + (startup--get-buffer-create-scratch))) 'follow-link t) (insert "\n") (insert "\n" (emacs-version) "\n" emacs-copyright "\n") @@ -2229,6 +2230,13 @@ display-about-screen (defalias 'about-emacs 'display-about-screen) (defalias 'display-splash-screen 'display-startup-screen) +(defun startup--get-buffer-create-scratch () + (or (get-buffer "*scratch*") + (with-current-buffer (get-buffer-create "*scratch*") + (set-buffer-major-mode (current-buffer)) + (setq-local lexical-binding t) + (current-buffer)))) + (defun command-line-1 (args-left) "A subroutine of `command-line'." (display-startup-echo-area-message) @@ -2378,7 +2386,7 @@ command-line-1 (unless (= end (length str-expr)) (error "Trailing garbage following expression: %s" (substring str-expr end))) - (eval expr))) + (eval expr t))) ((member argi '("-L" "-directory")) ;; -L :/foo adds /foo to the _end_ of load-path. @@ -2493,7 +2501,7 @@ command-line-1 (when (eq initial-buffer-choice t) ;; When `initial-buffer-choice' equals t make sure that *scratch* ;; exists. - (get-buffer-create "*scratch*")) + (startup--get-buffer-create-scratch)) ;; If *scratch* exists and is empty, insert initial-scratch-message. ;; Do this before switching to *scratch* below to handle bug#9605. @@ -2512,7 +2520,7 @@ command-line-1 ((functionp initial-buffer-choice) (funcall initial-buffer-choice)) ((eq initial-buffer-choice t) - (get-buffer-create "*scratch*")) + (startup--get-buffer-create-scratch)) (t (error "initial-buffer-choice must be a string, a function, or t."))))) (unless (buffer-live-p buf) diff --git a/lisp/window.el b/lisp/window.el index 8c5e441e4b..3f475ce8ae 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4578,7 +4578,7 @@ last-buffer (or (get-next-valid-buffer (nreverse (buffer-list frame)) buffer visible-ok frame) (get-buffer "*scratch*") - (let ((scratch (get-buffer-create "*scratch*"))) + (let ((scratch (startup--get-buffer-create-scratch))) (set-buffer-major-mode scratch) scratch))) From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 19 16:10:37 2018 Received: (at 30078) by debbugs.gnu.org; 19 Mar 2018 20:10:37 +0000 Received: from localhost ([127.0.0.1]:42220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ey177-0002CA-1A for submit@debbugs.gnu.org; Mon, 19 Mar 2018 16:10:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ey175-0002By-Ba for 30078@debbugs.gnu.org; Mon, 19 Mar 2018 16:10:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey16v-0004Gi-9B for 30078@debbugs.gnu.org; Mon, 19 Mar 2018 16:10:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey16v-0004GT-0Z; Mon, 19 Mar 2018 16:10:25 -0400 Received: from [176.228.60.248] (port=3457 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ey16u-0008Cf-Cd; Mon, 19 Mar 2018 16:10:24 -0400 Date: Mon, 19 Mar 2018 22:10:35 +0200 Message-Id: <83tvtbn7wk.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Mon, 19 Mar 2018 15:32:23 -0400) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Stefan Monnier > Date: Mon, 19 Mar 2018 15:32:23 -0400 > Cc: 30078@debbugs.gnu.org > > 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. Really? Get rid of dynamic binding in ELisp? Why is that a good idea? It would mean old code will not run in Emacs for no good reason. > It's dynamic binding which is the odd one out Not for me, it isn't. Maybe that means _I_ amd the odd one out. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 19 16:50:40 2018 Received: (at 30078) by debbugs.gnu.org; 19 Mar 2018 20:50:40 +0000 Received: from localhost ([127.0.0.1]:42239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ey1js-0003BJ-Ga for submit@debbugs.gnu.org; Mon, 19 Mar 2018 16:50:40 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:46447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ey1jo-0003B2-VE for 30078@debbugs.gnu.org; Mon, 19 Mar 2018 16:50:39 -0400 Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w2JKoYQ4008442; Mon, 19 Mar 2018 16:50:34 -0400 Received: by lechazo.home (Postfix, from userid 20848) id 88FD8632A7; Mon, 19 Mar 2018 16:50:34 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> <83tvtbn7wk.fsf@gnu.org> Date: Mon, 19 Mar 2018 16:50:34 -0400 In-Reply-To: <83tvtbn7wk.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 19 Mar 2018 22:10:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 <1781680> : uri <2611234> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >> 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. > > Really? Get rid of dynamic binding in ELisp? Not sure if by "dynamic binding" you mean "the variant of Elisp corresponding to lexical-binding = nil" (which I call dynbind-Elisp) or "some new Elisp variant where dynamic binding has been removed altogether" (which doesn't currently exist AFAIK). I have no intention to eliminate dynamic binding from Elisp at all. What I'd like to see happen within the next, say, 20 years is to get rid of the `lexical-binding` variable (i.e. treat everything as if this var were always non-nil and as if `eval`s second arg was always non-nil), so that dynamic binding only ever happens for those variables that have been explicitly declared to be dynamic with `defvar` (as is the case in what I call the lexbind-Elisp language). > Why is that a good idea? Because, having two languages is a bit inconvenient and brings extra complexity: e.g. some code snippets only work right in one of the two languages (usually nowadays it's in the lexbind variant, AFAICT), so you need to label them appropriately. > It would mean old code will not run in Emacs for no good reason. That's true. Which is why it's a long-term goal only. Note that it's usually easy to tweak that code to make it work again, tho it is occasionally a bit more painful. And we usually introduce other backward incompatibilities along the way, so it's rather rare for 20 year old Elisp code to still run correctly unmodified. >> It's dynamic binding which is the odd one out > Not for me, it isn't. Maybe that means _I_ amd the odd one out. Beside Elisp, I know you're familiar with at least one other language which only supports lexical scoping: C. What other language(s) do you know/use? Which scoping do they support? Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 20 02:59:12 2018 Received: (at 30078) by debbugs.gnu.org; 20 Mar 2018 06:59:12 +0000 Received: from localhost ([127.0.0.1]:42641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eyBEm-0007Ba-6E for submit@debbugs.gnu.org; Tue, 20 Mar 2018 02:59:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50341) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eyBEk-0007BN-NI for 30078@debbugs.gnu.org; Tue, 20 Mar 2018 02:59:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyBEc-0005kH-8u for 30078@debbugs.gnu.org; Tue, 20 Mar 2018 02:59:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyBEc-0005kA-5O; Tue, 20 Mar 2018 02:59:02 -0400 Received: from [176.228.60.248] (port=3858 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eyBEb-0000E0-AT; Tue, 20 Mar 2018 02:59:01 -0400 Date: Tue, 20 Mar 2018 08:59:12 +0200 Message-Id: <83k1u7mdvj.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Mon, 19 Mar 2018 16:50:34 -0400) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <83tvtbn7wk.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Stefan Monnier > Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org > Date: Mon, 19 Mar 2018 16:50:34 -0400 > > > Really? Get rid of dynamic binding in ELisp? > > Not sure if by "dynamic binding" you mean "the variant of Elisp > corresponding to lexical-binding = nil" (which I call dynbind-Elisp) or > "some new Elisp variant where dynamic binding has been removed > altogether" (which doesn't currently exist AFAIK). > > I have no intention to eliminate dynamic binding from Elisp at all. > What I'd like to see happen within the next, say, 20 years is to get rid > of the `lexical-binding` variable (i.e. treat everything as if this var > were always non-nil and as if `eval`s second arg was always non-nil), so > that dynamic binding only ever happens for those variables that have > been explicitly declared to be dynamic with `defvar` (as is the case in > what I call the lexbind-Elisp language). > > > Why is that a good idea? > > Because, having two languages is a bit inconvenient and brings extra > complexity: e.g. some code snippets only work right in one of the two > languages (usually nowadays it's in the lexbind variant, AFAICT), so you > need to label them appropriately. Are that inconvenience and complexity really so bad? They don't sound like that. > > It would mean old code will not run in Emacs for no good reason. > > That's true. Which is why it's a long-term goal only. I'm asking why make it a goal at all. > >> It's dynamic binding which is the odd one out > > Not for me, it isn't. Maybe that means _I_ amd the odd one out. > > Beside Elisp, I know you're familiar with at least one other language > which only supports lexical scoping: C. Global variables in C are very similar to dynamic binding, so I had no problem getting used to ELisp at the time. > What other language(s) do you know/use? Which scoping do they support? Every language I ever used (which is not a lot) supports global variables, so again, no problems in that department. Or maybe I again misunderstand what you mean by "dynbind". Anyway, I don't think it's worth our while to discuss what is or isn't a problem for me personally. The popular style of writing Emacs Lisp nowadays is very different from what it was 20 or 25 years ago, when I learned the language, which is an obstacle to someone like myself, who is not very interested in programming languages and their facilities. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 20 15:20:22 2018 Received: (at 30078) by debbugs.gnu.org; 20 Mar 2018 19:20:23 +0000 Received: from localhost ([127.0.0.1]:44278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eyMo2-0003t9-NP for submit@debbugs.gnu.org; Tue, 20 Mar 2018 15:20:22 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:46707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eyMo0-0003t1-RO for 30078@debbugs.gnu.org; Tue, 20 Mar 2018 15:20:21 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w2KJKIYj006039; Tue, 20 Mar 2018 15:20:19 -0400 Received: by pastel.home (Postfix, from userid 20848) id BEF3F62EC4; Tue, 20 Mar 2018 15:20:18 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> <83tvtbn7wk.fsf@gnu.org> <83k1u7mdvj.fsf@gnu.org> Date: Tue, 20 Mar 2018 15:20:18 -0400 In-Reply-To: <83k1u7mdvj.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 20 Mar 2018 08:59:12 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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, RV6246=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6246> : inlines <6508> : streams <1781769> : uri <2611785> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >> Because, having two languages is a bit inconvenient and brings extra >> complexity: e.g. some code snippets only work right in one of the two >> languages (usually nowadays it's in the lexbind variant, AFAICT), so you >> need to label them appropriately. > Are that inconvenience and complexity really so bad? They don't sound > like that. It's a source of bugs, slows down the interpreter, complicates the compiler, complicates the doc, regularly confuses new users who copy snippets of code and use them in the wrong language, ... Also several macros need to know if the code they generate will be interpreted in the lexbind-Elisp or the dynbind-Elisp language, so those are also impacted. The clear tendency is for new developments to drop support for dynbind-Elisp whenever it gets in the way (e.g. some macros just signal an error when used from dynbind-Elisp). So dynbind-Elisp is slowly becoming second class citizen. >> > It would mean old code will not run in Emacs for no good reason. >> That's true. Which is why it's a long-term goal only. > I'm asking why make it a goal at all. I guess in the worst case we could keep it indefinitely. But I hope that in the future no code ends up using dynbind-Elisp "by accident". IOW dynbind-Elisp should only be used upon explicit request (e.g. by setting lexical-binding to nil in the file-local vars or by passing a special `:dynbind` second argument to `eval`). Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 02 15:41:05 2018 Received: (at 30078) by debbugs.gnu.org; 2 Apr 2018 19:41:05 +0000 Received: from localhost ([127.0.0.1]:35414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f35KC-0003Re-UN for submit@debbugs.gnu.org; Mon, 02 Apr 2018 15:41:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60227) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f35KA-0003R2-FF for 30078@debbugs.gnu.org; Mon, 02 Apr 2018 15:41:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f35K4-0005YH-Ja for 30078@debbugs.gnu.org; Mon, 02 Apr 2018 15:40:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f35Jy-0005OU-AA; Mon, 02 Apr 2018 15:40:50 -0400 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1f35Jx-0004Vc-Ez; Mon, 02 Apr 2018 15:40:49 -0400 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Tue, 20 Mar 2018 15:20:18 -0400) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <83tvtbn7wk.fsf@gnu.org> <83k1u7mdvj.fsf@gnu.org> Message-Id: Date: Mon, 02 Apr 2018 15:40:49 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, eliz@gnu.org, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) [[[ 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. ]]] We need dynamic binding to run old programs which were written for it. We must keep it running forever for that reason. Aside from that, I don't see a case where we really need to use it. The 'e' command in the debugger needs to give access to the bindings of the code being debugged -- even if that code uses lexical binding. There are various ways to implement that. How is it implemented now? -- Dr Richard Stallman President, Free Software Foundation (https://gnu.org, https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) Skype: No way! See https://stallman.org/skype.html. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 02 20:12:52 2018 Received: (at 30078) by debbugs.gnu.org; 3 Apr 2018 00:12:52 +0000 Received: from localhost ([127.0.0.1]:35625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f39ZD-0005AX-6U for submit@debbugs.gnu.org; Mon, 02 Apr 2018 20:12:52 -0400 Received: from pmta21.teksavvy.com ([76.10.157.36]:32392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f39ZB-0005AL-2G for 30078@debbugs.gnu.org; Mon, 02 Apr 2018 20:12:49 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EkDwBzxsJa/06mSC1dHAEBAQQBAQoBA?= =?us-ascii?q?YMTL4FQgz2EaZBhgXQTfJRNC4UEAoQzITcVAQIBAQEBAQECA2gohSYBBAF5BQs?= =?us-ascii?q?LDQEmEhQYMYUYCLAAGgKIJoIlh2GCE4QQgVSIbwKFL5ILCIp/imAihGSPfYElM?= =?us-ascii?q?iOBUjMaCDCCfpBoI4w9K4IbAQE?= X-IPAS-Result: =?us-ascii?q?A2EkDwBzxsJa/06mSC1dHAEBAQQBAQoBAYMTL4FQgz2EaZB?= =?us-ascii?q?hgXQTfJRNC4UEAoQzITcVAQIBAQEBAQECA2gohSYBBAF5BQsLDQEmEhQYMYUYC?= =?us-ascii?q?LAAGgKIJoIlh2GCE4QQgVSIbwKFL5ILCIp/imAihGSPfYElMiOBUjMaCDCCfpB?= =?us-ascii?q?oI4w9K4IbAQE?= X-IronPort-AV: E=Sophos;i="5.48,398,1517893200"; d="scan'208";a="25860778" Received: from unknown (HELO fmsmemgm.homelinux.net) ([45.72.166.78]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Apr 2018 20:12:43 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 22D0AAE27B; Mon, 2 Apr 2018 20:12:43 -0400 (EDT) From: Stefan Monnier To: Richard Stallman Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: Message-ID: References: <87h8rsaz8z.fsf@web.de> <83tvtbn7wk.fsf@gnu.org> <83k1u7mdvj.fsf@gnu.org> Date: Mon, 02 Apr 2018 20:12:43 -0400 In-Reply-To: (Richard Stallman's message of "Mon, 02 Apr 2018 15:40:49 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, eliz@gnu.org, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > We need dynamic binding to run old programs which were written for it. > We must keep it running forever for that reason. In any case, I realized in the mean time that the issue is not so much whether we'll keep this forever for backward compatibility but whether we want to actively discourage its use. > The 'e' command in the debugger needs to give access to the bindings > of the code being debugged -- even if that code uses lexical binding. > There are various ways to implement that. How is it implemented now? It pays attention to the frame in which point is located when you hit `e`, then "unwinds" the bindings on the stack upto that frame temporarily while evaluating the code you typed. That same mechanism happens to work both for the dynamically bound variables and for the lexically bound ones (because the lexical environment is kept internally by the interpreter in a dynamically bound variable). Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 03 12:50:36 2018 Received: (at 30078) by debbugs.gnu.org; 3 Apr 2018 16:50:36 +0000 Received: from localhost ([127.0.0.1]:37302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3P8m-0002bR-BB for submit@debbugs.gnu.org; Tue, 03 Apr 2018 12:50:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3P8k-0002bD-HM for 30078@debbugs.gnu.org; Tue, 03 Apr 2018 12:50:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3P8e-0000S7-Eh for 30078@debbugs.gnu.org; Tue, 03 Apr 2018 12:50:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3P8X-0000NO-B9; Tue, 03 Apr 2018 12:50:21 -0400 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1f3P8W-0002hD-Qk; Tue, 03 Apr 2018 12:50:20 -0400 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Mon, 02 Apr 2018 20:12:43 -0400) Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-: References: <87h8rsaz8z.fsf@web.de> <83tvtbn7wk.fsf@gnu.org> <83k1u7mdvj.fsf@gnu.org> Message-Id: Date: Tue, 03 Apr 2018 12:50:20 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30078 Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) [[[ 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. ]]] > In any case, I realized in the mean time that the issue is not so much > whether we'll keep this forever for backward compatibility but whether > we want to actively discourage its use. I think we don't need to worry about that in advance. -- Dr Richard Stallman President, Free Software Foundation (https://gnu.org, https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) Skype: No way! See https://stallman.org/skype.html. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 19:56:27 2019 Received: (at control) by debbugs.gnu.org; 25 Apr 2019 23:56:27 +0000 Received: from localhost ([127.0.0.1]:59611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJoE7-0003ZZ-DV for submit@debbugs.gnu.org; Thu, 25 Apr 2019 19:56:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJoE4-0003ZM-Q7 for control@debbugs.gnu.org; Thu, 25 Apr 2019 19:56:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJoDz-0003aR-BP for control@debbugs.gnu.org; Thu, 25 Apr 2019 19:56:19 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hJoDz-0003Bo-03 for control@debbugs.gnu.org; Thu, 25 Apr 2019 19:56:19 -0400 Subject: control message for bug 30078 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Thu, 25 Apr 2019 19:56:18 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) # e08e088 close 30078 27.1 From unknown Sun Jun 15 08:59:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 24 May 2019 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator