From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: sbaugh@catern.com 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 12:22:44 +0000 (UTC) Message-ID: <87r0lqu7ho.fsf@catern.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18517"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Spencer Baugh , 63648@debbugs.gnu.org, Juri Linkov To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 19 14:23:51 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 1qtS45-0004bz-Vn for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Oct 2023 14:23:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtS3x-0000ZZ-Jp; Thu, 19 Oct 2023 08:23:41 -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 1qtS3r-0000XY-GA for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 08:23:35 -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 1qtS3r-0003tH-3u for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 08:23:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtS4H-00086b-LT for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 08:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Oct 2023 12:24:01 +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.169771820131093 (code B ref 63648); Thu, 19 Oct 2023 12:24:01 +0000 Original-Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 12:23:21 +0000 Original-Received: from localhost ([127.0.0.1]:36032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtS3d-00085R-6W for submit@debbugs.gnu.org; Thu, 19 Oct 2023 08:23:21 -0400 Original-Received: from s.wfbtzhsw.outbound-mail.sendgrid.net ([159.183.224.105]:22990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtS3a-000858-Se for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 08:23:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=+pb0pNY7psgDBu47hlLvIwJBatTX9Ghf38cl0h/ppgI=; b=tVWdUmNNuE5gBvjjMkXvAn5yJ4JuAQ67Imh6bGjCVGOMEjZ1Xff2RaQ7B9dXN26NMc8E vSiOsX7/mSIdBb/o5et2NWNXB2nlatYK53pA9sE6spk5q1SHyChvOrKs1vXJMOx5cjOjZQ XqtuJ0H5fjlFA3V2CkDTmuZ2LhnOuQqESKvysnjS2bs1q656yhyEQqGRoD4eSoUYbM6c4Y 1pu+96kVlL+GPYJz7RLufq39ktdE2HX4gh5oEnnlW/FrvZlrLyiAfBL3d2zsYHXZqoSoIi pwnmFGF1Jvqc8gb7OELQJ7SGfkgS2GttVOU/FxGJTj1L1EIP/29C8e0EXBIV3i5w== Original-Received: by filterdrecv-d585b8d85-tktxc with SMTP id filterdrecv-d585b8d85-tktxc-1-65311F94-24 2023-10-19 12:22:44.858936406 +0000 UTC m=+150145.192633501 Original-Received: from earth.catern.com (unknown) by geopod-ismtpd-17 (SG) with ESMTP id JWxpm3HBQ36QM7evnwoWQQ Thu, 19 Oct 2023 12:22:44.609 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gutov.dev Original-Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id E5E8E6006E; Thu, 19 Oct 2023 08:22:43 -0400 (EDT) In-Reply-To: <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> (Dmitry Gutov's message of "Thu, 19 Oct 2023 03:42:24 +0300") X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbJUrGlQzS6FU3zpT3Y3MLW8GPdsSGJCXMT/qpdbVmk1I2Lns6RfIsjBuQxjRJlJwURw1zg+gw7x0x+maTICoDtWau0RRhM0428ekyQwL6vOgG8GKTwVAGNXsON5cswoWKnq/XZXFRCzI+1z1EadpbDRjJS4poXtPrVuM3wMy2GcUw== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== 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:272730 Archived-At: 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. 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. 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. 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.