From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Date: Fri, 1 Sep 2023 12:53:02 +0300 Message-ID: <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32786"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 01 11:54:14 2023 Return-path: 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 ) id 1qc0qz-0008I8-MI for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Sep 2023 11:54:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc0qj-00036C-JA; Fri, 01 Sep 2023 05:53:57 -0400 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 1qc0qh-00035y-MN for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 05:53:55 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qc0qh-0005UU-EH for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 05:53:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qc0qo-0000bG-4o for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 05:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Sep 2023 09:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63648 X-GNU-PR-Package: emacs Original-Received: via spool by 63648-submit@debbugs.gnu.org id=B63648.16935620032255 (code B ref 63648); Fri, 01 Sep 2023 09:54:02 +0000 Original-Received: (at 63648) by debbugs.gnu.org; 1 Sep 2023 09:53:23 +0000 Original-Received: from localhost ([127.0.0.1]:59894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc0qA-0000aI-NK for submit@debbugs.gnu.org; Fri, 01 Sep 2023 05:53:23 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:39713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc0q8-0000a3-OL for 63648@debbugs.gnu.org; Fri, 01 Sep 2023 05:53:21 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 8891B3200926; Fri, 1 Sep 2023 05:53:05 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 01 Sep 2023 05:53:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693561985; x=1693648385; bh=ljX6vArHzwX7PPNuoN749XdGX/98fR3qO2i u4bQCck8=; b=b68Gl3kl5V3BidlSKif1GsiwoFUu2nyC37g2iGiWehKhI36EI3J rF71u09uSZFzYBkj79J1Sd3d+epe1e/hrhii8+E4lb6+9d831TeC/yLpjZcTt0pK Vut29UOLI4uwDBhF/aUJT9oUDA0aW3RFCgedeeqZ1+6m/RXisu831prziTUW076Y 9c9T5CY1oqqNcBtRynRHQ/E99e97Vw3rbO51TKC52tTQI0fjMh2oh7o7K/3kMP3G WGNHx+vC8w7xTAqb6rb9ut7AWB/YZ9W5m4xoTttJiEAJFeayx+0yeWkZ6ifs+1wK PndwimM4xyNEhtlYc1H9FTnhp5EJX0RIZWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693561985; x=1693648385; bh=ljX6vArHzwX7PPNuoN749XdGX/98fR3qO2i u4bQCck8=; b=zLyyABRcuoWPdeOOinNitkDVsz3scnDhFx14vsmSyDecyyBJMTN 0vUcijbhpM73gXe2cveYBWRnKGPp5G10dU0HqnYDAcwACbg/Smif1w7Z/tGQgl0K HdAubmADmz1lxHa4X5TpjRzR/0Cz55CTo+OssT3QM0vBrBOKEA66XPvJdYrDtXDy +J4R81AeHxOmCK7OTym1PxzQoiKaIkEUmXJkjjux1RySHLiuIL/YtG61S+tVwwJk SgnQM46+Yk60soKsPR/fPyPRsD7XYVrfZYqqnKP8KqJHffrM7kgHVC3xiSC4a3j9 TdkKY9qK6kxBpy22dj2EYl7Nol2eJudN1JA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegvddgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Sep 2023 05:53:03 -0400 (EDT) Content-Language: en-US In-Reply-To: <8634zyjt0k.fsf@mail.linkov.net> 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" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268873 Archived-At: On 01/09/2023 09:46, Juri Linkov wrote: >>> (let ((default-directory "/tmp/")) >>> (list default-directory >>> (buffer-local-value 'default-directory (current-buffer)))) >>> => ("/tmp/""/tmp/") >>> Here is the shortest test case: 'C-x p p C-b' shows buffers >>> from two projects when using let-binding for default-directory, >>> because 'project-buffers' relies on >>> (buffer-local-value 'default-directory buf) >>> This could be fixed by adding special-handling of the default-directory >>> for the current buffer in 'project-buffers'. >> What kind of special handling? The "real" buffer-local value is hidden >> until the "let" exists, the global value is nil, and if the buffer is not >> a file-visiting one, there is no other file name to test against. > Additional buffer-local variable like 'buffer-default-directory' could help. > Or additional global variable 'global-default-directory'. Or even > using the global value of the existing variable 'default-directory'. What code would use it instead of the local value of default-directory? Only project-related code? Or other code as well? If it's the former, we have an existing variable in the project package. If the latter, we'd need some formal description of those usage rules to proceed. >> Finally, whatever special handling we invent, would have to be mirrored by >> all subsequent new commands (built-in and third-party) which look up the >> value of default-directory. Especially project-related ones. How to >> popularize that knowledge, would be the next question for whatever solution >> we invent. > Hopefully there should be not much trouble such as in 'project-buffers'. I think there exists a class of commands (existing and potential ones) that would use default-directory with exact same purpose and expectations.