From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Stefan Monnier via "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#45619: 28.0.50; pcase-let on MacOS doesn't work
Date: Sat, 12 Feb 2022 09:56:37 -0500
Message-ID: <jwvr188ywem.fsf-monnier+emacs@gnu.org>
References: <tencent_420EB82A750AC42DCD81ECB23589C171FE07@qq.com>
 <877dos50su.fsf@web.de> <87k0e04jet.fsf@gnus.org>
Reply-To: Stefan Monnier <monnier@iro.umontreal.ca>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="37844"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cc: Michael Heerdegen <michael_heerdegen@web.de>, jixiuf <jixiuf@qq.com>,
 45619@debbugs.gnu.org
To: Lars Ingebrigtsen <larsi@gnus.org>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 12 15:57:11 2022
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1nItpm-0009ds-3B
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Feb 2022 15:57:10 +0100
Original-Received: from localhost ([::1]:59424 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1nItpk-0004lO-Hj
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Feb 2022 09:57:08 -0500
Original-Received: from eggs.gnu.org ([209.51.188.92]:40452)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1nItpe-0004jH-6t
 for bug-gnu-emacs@gnu.org; Sat, 12 Feb 2022 09:57:02 -0500
Original-Received: from debbugs.gnu.org ([209.51.188.43]:41556)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1nItpd-0004en-Tw
 for bug-gnu-emacs@gnu.org; Sat, 12 Feb 2022 09:57:01 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nItpd-0003Ig-QD
 for bug-gnu-emacs@gnu.org; Sat, 12 Feb 2022 09:57:01 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Stefan Monnier <monnier@iro.umontreal.ca>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sat, 12 Feb 2022 14:57:01 +0000
Resent-Message-ID: <handler.45619.B45619.164467780812664@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 45619
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: moreinfo
Original-Received: via spool by 45619-submit@debbugs.gnu.org id=B45619.164467780812664
 (code B ref 45619); Sat, 12 Feb 2022 14:57:01 +0000
Original-Received: (at 45619) by debbugs.gnu.org; 12 Feb 2022 14:56:48 +0000
Original-Received: from localhost ([127.0.0.1]:35453 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1nItpQ-0003I7-BO
 for submit@debbugs.gnu.org; Sat, 12 Feb 2022 09:56:48 -0500
Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:17100)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@iro.umontreal.ca>) id 1nItpP-0003Hk-10
 for 45619@debbugs.gnu.org; Sat, 12 Feb 2022 09:56:47 -0500
Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AED5A80008;
 Sat, 12 Feb 2022 09:56:40 -0500 (EST)
Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 34304804EC;
 Sat, 12 Feb 2022 09:56:39 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1644677799;
 bh=B5WSHwJiwKhSz6NDb6mXeWxpW+HvFf/JywHX2C0mfBU=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=YfmYPq3zjFyt7bjQZOSfkMmw35UPzDZB90Pfav83EC0KX0trQsGizcPWntewcbY74
 5iHCT23AgGbv9d15E07wRJiZ8poZ9xZTl+koffsYo/TsjuolTSsc2m5kqfWU7HJqSn
 KYw0SlQbVyBsMy519SaVWf4WNzCyLa7kjnuv0SW2VPENWex6hD6+Tbka1dZeeRdUnF
 wZnrJi5YFak6q/a3emMbmxZ9jBZy0H8RFo9XGmPyHvc3s5eUavaJd1CXXCQuIDtntz
 hN8/SM0sBTWHv4Bc4i1v0bkp9D7T4hxpyMWui9f5NGbSjRawIMmSg2yr1VpdIXN9oF
 hpjeM3Bm2pf3w==
Original-Received: from ceviche (modemcable034.207-20-96.mc.videotron.ca [96.20.207.34])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DF62B1203BF;
 Sat, 12 Feb 2022 09:56:38 -0500 (EST)
In-Reply-To: <87k0e04jet.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat,
 12 Feb 2022 08:46:02 +0100")
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: "bug-gnu-emacs"
 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Xref: news.gmane.io gmane.emacs.bugs:226728
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/226728>

Lars Ingebrigtsen [2022-02-12 08:46:02] wrote:
> Michael Heerdegen <michael_heerdegen@web.de> writes:
>>> (pcase-let ((`(,default-directory) '( "/tmp/")))
>>>     (call-interactively 'find-file))
>>>
>>> Expected behavior: Find file in "/tmp/"
>>> Observed behavior: Find file in "~"
>>
>> AFAICT the issue here is that `pcase-let' always creates lexically
>> scoped bindings, even for special variables.  That can be surprising.
>>
>> @Stefan, what can we do?  Document better?  Add compiler warnings?  Or
>> is it possible to "fix" this?
> I tried the form in Emacs 29, and I got the expected behaviour here.  So
> was this fixed since this bug was reported?  (But I only tested on Debian.)

Hmm... I doubt it's fixed in all cases.
I still think pcase should emit a warning when asked to bind
a dynamically scoped variable.


        Stefan