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: Thu, 19 Oct 2023 15:49:20 +0300 Message-ID: <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> References: <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87r0lqu7ho.fsf@catern.com> 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="40598"; 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, Juri Linkov To: sbaugh@catern.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 19 14:50: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 1qtSTd-000AJK-AG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Oct 2023 14:50:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSTS-0000Ps-UI; Thu, 19 Oct 2023 08:50:03 -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 1qtST5-0008K4-Tp for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 08:49:47 -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 1qtST2-0005AI-6r for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 08:49:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtSTS-00036J-Ic for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 08:50: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: Thu, 19 Oct 2023 12:50: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.169771980011906 (code B ref 63648); Thu, 19 Oct 2023 12:50:02 +0000 Original-Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 12:50:00 +0000 Original-Received: from localhost ([127.0.0.1]:36069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtSTP-00035y-PD for submit@debbugs.gnu.org; Thu, 19 Oct 2023 08:50:00 -0400 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:41697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtSTN-00035i-In for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 08:49:58 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id ADF023200AE6; Thu, 19 Oct 2023 08:49:24 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Oct 2023 08:49:25 -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=fm1; t= 1697719763; x=1697806163; bh=BgFrGAAEzHUbR/YiOwb1GJDTlZFqs3jxH6m N8Q9322U=; b=cdLhdx1GZhy9MDZCZYYQylF3qAHme6K8Nr/s3wP++aLwx1FLQcU dl57HzgfAny6C90WLAdh8o2u836BJ5mhguWhoIn2cUlJBT+W87DnRLqf/Utac4Z1 tRvIMc5PWkEZYNsDFxylpioRowifW/RrEcOIK2An7r24eg/ZIvACx46DIr8nBlVm NU/ek1QJrtC8VdrNu0p/ZqGHwXqwILN8JEkqW6PGflMzqSUojP/XO3sKkjNCm+OJ Oo3tRyNNIuA7t0/hqBHa0UI5NY3QeQuJ1Uz+m66MPqu2MofC51N7TWoc2ch2axa8 hEiMbiNl9TzVD8HvHXs8/LNBGdHOnqgNqRg== 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=fm3; t= 1697719763; x=1697806163; bh=BgFrGAAEzHUbR/YiOwb1GJDTlZFqs3jxH6m N8Q9322U=; b=o1IIXB8cVVrrKhwWl8M7L0ZULtbpxum66X81dazVsO1Eta2TQJ5 QGUOUIo/axFKSy3ndJI+6E0gAttWPSrU3+jDwk5HSjer9+GzK9rImfKXj6EHTejM ioShpBxYUzWs9kyGtOtaqAVglewVQXnpwKgh952WpelNoe2psu362Bi+2So4Huk0 9ENG1+Ab6k5Ug1Wgwkvn/u526LsyLSl0+GPX/NKYSqywSCMZRdS3gv9vOzdDbKI+ IqweUQxoHlldPm+SDORK471MhIijTL7K2qQeKR4St+opV+g7wHPNcEQGe+JTKOae v7nIjGHP9yJKG/wwRM89h21igZzzH6iPLng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeeigdehjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpefhuedtkeevgeegteetkeefjeffgeduudduhfeuveelfedtffffgeegiedvvdej leenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Oct 2023 08:49:22 -0400 (EDT) Content-Language: en-US In-Reply-To: <87r0lqu7ho.fsf@catern.com> 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:272733 Archived-At: On 19/10/2023 15:22, sbaugh@catern.com wrote: > Dmitry Gutov writes: >> Hi Juri, >> >> On 22/09/2023 18:52, Juri Linkov wrote: >>>>> Probably. Would you like to propose one? So that I have something to >>>>> compare to, and have something specific to put to the vote as well. >>>> >>>> Ok, something like this: >>> Here is a more tested patch. It supports these cases: >>> (setq project-switch-use-entire-map t) >>> C-x p p C-b - should not include current buffer in the list of >>> another project (bug#58784) >>> C-x p p f M-n - should fetch the right default file name (bug#58784, bug#63829) >>> C-u C-x p p f emoji TAB - should include ignored emoji-labels.el (bug#63648) >>> C-x p p C-x d - should visit another project's root (bug#63648) >>> The same with frames: >>> C-x 5 p p C-b >>> C-x 5 p p f M-n >>> C-u C-x 5 p p f emoji TAB - should not show completions in another frame (bug#65558) >>> C-x 5 p p C-x d >> >> Thank you. Especially for the list. >> >> But I think we still haven't reached a decision whether the "loop >> until correct key is pressed" behavior is useful. >> >> I tried to think how to fit the above requirements into the existing >> model, and it seems to require a new command, and an additional key >> being pressed sometimes, for explicitness. >> >> The attached patch also includes your fix for bug#65558, which seems >> orthogonal to our dilemma, and could probably be installed >> separately. It could be dry-ed up a little, though. >> >> Anyway, with the attached counter-proposal, the list looks like this: >> >> C-x p p C-b - works when project-switch-use-entire-map=t >> C-x p p f M-n - always works >> C-u C-x p p f - same >> C-x p p C-x d - the key sequence is 'C-x p p o C-x d' >> >> With frames: >> >> C-x 5 p p C-b - works when project-switch-use-entire-map=t >> C-x 5 p p f M-n - always works >> C-u C-x 5 p p f emoji TAB - same (thanks to your fix, included) >> C-x 5 p p C-x d - the key sequence is 'C-x 5 C-x p p o C-x d' >> >> The user could add project-list-buffers (or project-switch-to-buffer) >> to project-switch-commands, though, and then >> project-switch-use-entire-map won't be needed. Either way's fine. >> >> To sum up, that does require pressing an extra key to use commands >> outside of project-prefix-map, but OTOH that key is shown right in the >> commands menu. And one doesn't have to (setq >> project-switch-use-entire-map t) to use it, though that doesn't hurt >> either. >> >> And the meaning of project-switch-use-entire-map remains as it >> currently is: expand the set of keys to the whole project-prefix-map, >> but not to all local and global ones. >> >> WDYT? > > Hm, I personally think having to hit the extra "o" is undesirable. I'm > not sure whether "C-x p p o" would be an improvement over the current > state of the world: you can already hit "C-x p p D" to run > project-dired, so you end up in dired at the root of the project, and > then run whatever command you like with default-directory=project-root. It makes this capability apparent, and it's still one fewer keystroke (and 'o' is close to 'p', too). > The main downside of C-x p p D is that it necessarily switches buffers, > which I often don't want. Solving that would be nice, but it would be > nice to also get a shorter keybinding out of it. > > Actually, this gives me an idea. What if we embraced having C-x p p > switch buffers? What if we had a new command which jumps you to some > new "project status buffer", whose default-directory=project-root, and > which has single-letter bindings for the current project-prefix > commands? Similar to vc-dir. We could probably find some useful > information to display in that buffer, too, like a header which extracts > the status from the project's compilation buffer, or a list of the > buffers in the project. I'm totally on board with adding such command, except I'm not sure if we will give away the 'C-x p p' binding to it. But as far as calling the "next" command, both project-vc-dir and project-dired currently satisfy your condition, right? > If we replaced C-x p p with this command, then that would avoid all our > issues with default-directory and command loops and so on, by just > biting the bullet and switching buffers. Except when one wants to call a command that takes the current buffer into account. And/or its contents in particular (e.g. file name at point). > Although, maybe we can get the best of both worlds by having C-x p p > just temporarily switch buffer? It can do (with-current-buffer > (project-status) ...) plus resolving keybindings as if they were typed > in the project-status buffer. That seems pretty elegant to me and > resolves a lot of complexities without giving up anything. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63829 was a problem caused by a similar approach in the implementation. OTOH, https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58784 probably doesn't apply (most of the time; unless the projects are nested or whatever).