From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: lexical-binding is turned on in more use cases Date: Sun, 08 Mar 2020 13:33:07 -0400 Message-ID: References: <83pndo9zeb.fsf@gnu.org> <83o8t6bx2p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/x-markdown; coding=UTF-8 Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="73052"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 08 18:33:54 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jAzoH-000IrO-IK for ged-emacs-devel@m.gmane-mx.org; Sun, 08 Mar 2020 18:33:53 +0100 Original-Received: from localhost ([::1]:59896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAzoG-0004Ha-KI for ged-emacs-devel@m.gmane-mx.org; Sun, 08 Mar 2020 13:33:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51046) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAznd-0003rB-4u for emacs-devel@gnu.org; Sun, 08 Mar 2020 13:33:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAznb-0005jI-RP for emacs-devel@gnu.org; Sun, 08 Mar 2020 13:33:12 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6537) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jAzna-0005iZ-Hb; Sun, 08 Mar 2020 13:33:10 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DE80944F15C; Sun, 8 Mar 2020 13:33:09 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4BE9844F13D; Sun, 8 Mar 2020 13:33:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1583688788; bh=0ov4qZNDbDX66wrjSXYfX2eRZTgfcUUUKSihL6FUAeY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Ksir17Dg7/0QzPamsV8X0wzwvfA6+eQu4IFfGQCjJla0DWn3ctwa7p/0hLAhDkH+V PfdKVeKenwg06/BIh5/5L0DuAmjDF1cYAS6MQw00c/TsZHjHZITpf74HjJsqvI4lvK 53kHtCzD9XJvwv1aH9VPyNbU6HkA0ylJtvC1lG34hy93dbhfbVVFPpEg8ihB3ocnio y9+Ji7xypQAB4EdFbC+NpOH9qaCavHsnQhAADHUhIXpGejrWKsNZMa//PgDfzclMTk bk1j8WM2ug25n5GSqMpxjKbB2ycKLj8KC9YvZh9UY14aTxQNvx40f/14bAWvSxYpqC 3cnJnGpePNxqw== Original-Received: from pastel (unknown [216.154.50.221]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DCCA21205F8; Sun, 8 Mar 2020 13:33:07 -0400 (EDT) In-Reply-To: <83o8t6bx2p.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 08 Mar 2020 19:01:02 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245350 Archived-At: >> > Commit e08e0880f made lexical-binding be non-nil in more use cases, >> > but the NEWS entry doesn't say how to get back the old behavior. Is >> > there a way of getting back the old behavior, say, for M-: or for >> > "--eval" options? >> Not really, no. You can do things like replacing `` with `(eval >> ')` or adding a bunch of `(defvar )`, but there's no >> config var to get back the old behavior. > And neither can one bind something in the form being evaluated, > AFAICS, right? You can wrap your code inside a `(eval '...)`, but not a `let` binding, no. > Isn't that a bit too harsh? I don't see why: lexical-binding gives a strict superset of what can be done without it, and the cases where existing dynamically-scoped code gives a different results from its interpretation with lexical-binding are rather uncommon, especially in small chunks of code such as those typically used in `M-:` and `--eval`. That doesn't mean that I expect it won't break anything in practice: I do expect that some Makefile somewhere will be broken because of a `--eval` that depends on dynamic binding. But I think it'll be just as easy to fix with a `defvar` or an `eval` as it would be by setting or let-binding some new variable. Stefan