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: Sat, 2 Sep 2023 04:47:44 +0300 Message-ID: <09a33cba-b94a-55a1-6b2a-ea5e08f751fc@gutov.dev> References: <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> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> 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="29831"; 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: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 02 03:49:15 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 1qcFlC-0007TO-CE for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Sep 2023 03:49:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcFkt-0004Mn-5j; Fri, 01 Sep 2023 21:48:55 -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 1qcFkr-0004Mc-IF for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 21:48:53 -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 1qcFkr-0007z3-Am for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 21:48:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcFl0-0001Kz-En for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 21:49: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: Sat, 02 Sep 2023 01:49: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.16936192864859 (code B ref 63648); Sat, 02 Sep 2023 01:49:02 +0000 Original-Received: (at 63648) by debbugs.gnu.org; 2 Sep 2023 01:48:06 +0000 Original-Received: from localhost ([127.0.0.1]:34592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcFk5-0001GH-PL for submit@debbugs.gnu.org; Fri, 01 Sep 2023 21:48:06 -0400 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:38751) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcFk4-0001FG-0e for 63648@debbugs.gnu.org; Fri, 01 Sep 2023 21:48:05 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 02B4B320092D; Fri, 1 Sep 2023 21:47:47 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 01 Sep 2023 21:47:48 -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= 1693619267; x=1693705667; bh=oPeP6Z1pqJ55uWj0b1bQAHmUbBeEnz3BR6W pcPY7I9Y=; b=EU829/wdgJ+H/igtOys3Jz2wl2xhcKcJS3Hnrum5GesPSZ93+xb ia/4kjsgFlC60rx9TWwX1A4E4pS5coD/LuarIhsNbPOC/BwDdoWqYgdY3yj6PnvK tB+EfIdXFHOnpLZwa1W5gHUDVt0qFldwA5rrFXtx/FuQIyHAILTW4T2c56lzkJDh 7QHeIljmXdU9Xeco8WB9UjV5Q8+JD51lXan7h3NsosDhS366p1tODMqnqgA5iH4s 0LrYlQl7XvCkmGHebRcpsCmmjCBQApogHKcgs1pIe2b3MUzoDETrWayjHhdeWA9O FdA5Cr/eImVTsJQWxvgpN34qdPiEmJ653lw== 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= 1693619267; x=1693705667; bh=oPeP6Z1pqJ55uWj0b1bQAHmUbBeEnz3BR6W pcPY7I9Y=; b=HQzbEWhADBptRWxdY/nd1bmfYt6CwlVxFiuzTUAF9pa2auLDdB1 IWaCfO+Xb6FAWeQJcGfd9hMMs2bIL6/cA1bmQwPIGJg5teTlLY3U8SfzqzfvaQR5 fO7Rdu5shMnSCx10saYK1e9HsMFytmWFEXm0o8avfIXYg5v6h7GC5DaI2S+/faq5 mmtdE2biZuzQ1om+vkFErIInvdXbo0koWHCQJHlC5QkEh3NTSk14bmLu8z4CbYxy I9sGtaDSsngDtoyvTdcqMp2rlk4menKDdK4euPakJgtvYlPe/A+OwLZ9agDw/rYu C2zUJhBLLHGFl00hKzdED8rNr/hhqv6bxdQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegfedghedvucetufdoteggodetrfdotf 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 21:47:45 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:268947 Archived-At: On 01/09/2023 18:59, Spencer Baugh wrote: >>> 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. > > Thinking about it, I guess there's (roughly) two classes of commands > which want different things from default-directory, classes 1 and 2: > > 1. wants whatever the current value of default-directory is (and gets > this by just using default-directory as a variable) > > 2. wants the value of default-directory for some specific buffer X (and > gets this either with buffer-local-value or by using > with-current-buffer) > > If we could change 1 without changing 2, then we'd be happy. Yes, maybe. > This gets back to my earlier suggestion, that we have some way of > binding a variable which does not change the buffer-local value. > Supporting that would require fairly deep changes in C of course. > > (But actually, maybe it would be useful for Lisp threads? In fact, > maybe Lisp threads already support this? Because when you're in a > thread and you bind default-directory, you don't want that to affect any > other threads, you only want it to affect code running directly under > you.) It might be useful, sure. But as for how reasonable would be to have such a primitive, I'd rather defer to our language gurus (a question on emacs-devel would be a good idea). > Anyway, I'm coming around to the idea that actually the "changing the > local value of default-directory" problem isn't that big of a deal. We > can do something special for project-buffers, and that would make things > work OK with the next-default-directory approach, and if we run into > further problems in the future, we'll rethink at that time. > > Maybe with more time running with the code, we will come up with > something new and clever. It's a minor problem, but we've already went through two rounds on bug#58784 (first finding one solution, then a problem with it, and ending up with project-current-directory-override). I'd rather not throw out a solution that covers the known edge cases too eagerly. So I don't like an idea of a "special fix" in project-buffers, but if anyone has a specific patch to show, please go ahead.