From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: Re: Why is lexical-binding's global value ignored? Date: Sun, 29 Jan 2023 12:36:00 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35073"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) Cc: emacs-devel@gnu.org To: tomas@tuxteam.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 29 20:58:47 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pMDp7-0008y1-Vg for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Jan 2023 20:58:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMDoi-0003tp-AI; Sun, 29 Jan 2023 14:58:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMDog-0003tI-9f for emacs-devel@gnu.org; Sun, 29 Jan 2023 14:58:18 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMDoe-0003P3-H6 for emacs-devel@gnu.org; Sun, 29 Jan 2023 14:58:18 -0500 Original-Received: from localhost ([::ffff:197.239.12.54]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000010B846.0000000063D6CFB8.00003D1A; Sun, 29 Jan 2023 12:57:44 -0700 Mail-Followup-To: tomas@tuxteam.de, emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302763 Archived-At: * tomas@tuxteam.de [2023-01-28 10:12]: > On Fri, Jan 27, 2023 at 08:01:47PM -0700, abq@bitrot.link wrote: > > If somebody does (setq-default lexical-binding t), the intention is obvious. > > But in current versions of Emacs, when loading a file that doesn't specify a > > local value for lexical-binding, the global value is ignored. Why? > > > > IOW, what would break if the global value were honored? It defaults to nil, > > which is already how files are loaded if no local value is specified, so > > honoring the global wouldn't change anything by default. > > I think it's backward compatibility, mainly. Files with no explicit > lexical binding setting (may) contain code which expects dynamic > binding and would break. Some programs cannot work with lexical binding turned on. Such is the RCD Template Interpolation System for Emacs: https://hyperscope.link/3/7/1/3/3/RCD-Template-Interpolation-System-for-Emacs.html I use that package for text based spreadsheet-like calculations. Demonstration here: https://gnu.support/images/2022/11/2022-11-11/2022-11-11-11:11:11.ogv Calling it from lexical bindings works only with modified `rcd-dlet' function, how it was in it's original. Calling is one aspect of it. Other application that does not work with lexical binding is `eev' package. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/