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, 21 Oct 2023 21:41:28 +0300 Message-ID: <5405ef33-7754-1098-a1a2-98a8c8afe396@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> <87bkcst8b8.fsf@catern.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------FMFjdA4hZRIKy0ABIQ4BfA7W" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35110"; 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 Sat Oct 21 20:42:48 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 1quGvv-0008vN-Bb for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Oct 2023 20:42:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quGvk-0007Pk-3X; Sat, 21 Oct 2023 14:42:36 -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 1quGvi-0007PZ-Dy for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 14:42:34 -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 1quGvi-0007Vt-3k for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 14:42:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quGwA-00080a-02 for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 14:43: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, 21 Oct 2023 18:43: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.169791373330708 (code B ref 63648); Sat, 21 Oct 2023 18:43:01 +0000 Original-Received: (at 63648) by debbugs.gnu.org; 21 Oct 2023 18:42:13 +0000 Original-Received: from localhost ([127.0.0.1]:45037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quGvL-0007zC-Bg for submit@debbugs.gnu.org; Sat, 21 Oct 2023 14:42:12 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:41457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quGvG-0007ye-4s for 63648@debbugs.gnu.org; Sat, 21 Oct 2023 14:42:09 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id ED2BE5C0129; Sat, 21 Oct 2023 14:41:32 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 21 Oct 2023 14:41:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc: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=1697913692; x=1698000092; bh=vt 2TpBElRE/0VFI23YPNLOVViydyGQtHCLh7gGMZPk8=; b=sAETdov8xOBniNLThj 6fk4E7T/9SjgOEXNkyPwUE/vOlhwuht4Xzo+AuJBFlGNyQfN9yz+huMiijPPghlp AGYoMs24JpTgNX5M0u6q4an0oK9oUYJ23ISKKc72vgyd/82bnpDolwRzDrySfh27 ekd6nLrtskV0h3K0SwdK+M9alQo8FzRxUsVdXLZXNp9ufSGAlBEu1hDQ3FZSCzLe Iin/4TnY3tSu7RF3601GzJWIL9aMfXLOMvOUUCI8rWKL6N0wrupaqH0VpuKwhmS+ hGJjUnyXpv6XEmQp3yKcVp1c1H+L5G1ZlqCcGSrAtNpJyDPwuHIMscmBxDETRjlO /AEQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1697913692; x=1698000092; bh=vt2TpBElRE/0V FI23YPNLOVViydyGQtHCLh7gGMZPk8=; b=qbOPAT4ZdpSyvpItAVnw5F6aGLDBq l+zE/JRicscXiBxYf+Gpg8PW8HX54tx4v1YQy4fM46k1nMFmDzlF+MicCdpBjkn9 Q+OozItYgF5bGq9O1Y87jFo6mCwHUFkh2pbSf1MC4IMS2MKlLGa4p8bKpuGNd8fX hwlSZJj3nbkGus4vI4f98Qs7RfZMcJstH2xMrTVheDaKM1pROpCDyxP4QMregpQG MYvkADZhl4AyvLsaWmToySGVv345gRYxqpHEbpFt1dLvgelBXGW/1hpxWRYHV2ws ypYqRbbjc642uqpguNUOQUu3xr4/0CtLbI0p+9nJzwUx+s5PTWexN6Vfg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkedtgdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeehteekgfetieeujeeuvddtvdelteffleejteduvdefffejieehheeuteffveei jeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Oct 2023 14:41:30 -0400 (EDT) Content-Language: en-US In-Reply-To: <87bkcst8b8.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:272929 Archived-At: This is a multi-part message in MIME format. --------------FMFjdA4hZRIKy0ABIQ4BfA7W Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 21/10/2023 16:27, 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. > > Two thoughts: > > 1. Maybe C-x p o should also exist, which runs the subsequent command in > project-root. (Although I think it would be better if C-x p > magically let you type any binding after C-x p, and the command would > run in project-root, as I pondered much earlier in this thread. But > that's a lot harder...) Then the 'C-x p p' binding wouldn't be available?... Anyway, try the attached updated patch. > 2. Maybe C-x p p should have both `o` (on by default even without > project-switch-use-entire-map) and the no-extra-key version (needs to > be explicitly turned on, possibly by project-switch-use-entire-map) The patch plus (setq project-switch-commands 'project-any-command) should do that for you. > Although, I plan to turn the no-extra-key version on for all my users > anyway. The one extra key is a real cost if you're doing this > frequently. --------------FMFjdA4hZRIKy0ABIQ4BfA7W Content-Type: text/x-patch; charset=UTF-8; name="project-other-command-v2.diff" Content-Disposition: attachment; filename="project-other-command-v2.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwgYi9saXNwL3Byb2dtb2Rl cy9wcm9qZWN0LmVsCmluZGV4IGZkYTEwODFlYjYyLi4yNTAwYWNkMzk2MSAxMDA2NDQKLS0t IGEvbGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9wcm9q ZWN0LmVsCkBAIC04NDcsNiArODQ3LDcgQEAgcHJvamVjdC1wcmVmaXgtbWFwCiAgICAgKGRl ZmluZS1rZXkgbWFwICJHIiAncHJvamVjdC1vci1leHRlcm5hbC1maW5kLXJlZ2V4cCkKICAg ICAoZGVmaW5lLWtleSBtYXAgInIiICdwcm9qZWN0LXF1ZXJ5LXJlcGxhY2UtcmVnZXhwKQog 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pbiAlc10iIChwcm9qZWN0LXJvb3QgcHIpKSkKKyAgICAgICAgICAg ICAgICBwcmVmaXgtY29tbWFuZC1lY2hvLWtleXN0cm9rZXMtZnVuY3Rpb25zKSkKKyAgICAg ICAgIChjb21tYW5kIChrZXktYmluZGluZyAocmVhZC1rZXktc2VxdWVuY2UgIiIpIHQpKQor ICAgICAgICAgKHJvb3QgKHByb2plY3Qtcm9vdCBwcikpCisgICAgICAgICBmb3VuZCkKKyAg ICAod2hlbiBjb21tYW5kCisgICAgICA7OyBXZSBjb3VsZCBhbHNvIGNoZWNrIHRoZSBjb21t YW5kIG5hbWUgYWdhaW5zdCAiXFxgcHJvamVjdC0iLAorICAgICAgOzsgYW5kL29yIChnZXQg Y29tbWFuZCAncHJvamVjdC1jb21tYW5kKS4KKyAgICAgIChtYXAta2V5bWFwCisgICAgICAg KGxhbWJkYSAoX2V2dCBjbWQpIChpZiAoZXEgY21kIGNvbW1hbmQpIChzZXRxIGZvdW5kIHQp KSkKKyAgICAgICBwcm9qZWN0LXByZWZpeC1tYXApCisgICAgICAoaWYgZm91bmQKKyAgICAg ICAgICAobGV0ICgocHJvamVjdC1jdXJyZW50LWRpcmVjdG9yeS1vdmVycmlkZSByb290KSkK KyAgICAgICAgICAgIChjYWxsLWludGVyYWN0aXZlbHkgY29tbWFuZCkpCisgICAgICAgIChs ZXQgKChkZWZhdWx0LWRpcmVjdG9yeSByb290KSkKKyAgICAgICAgICAoY2FsbC1pbnRlcmFj dGl2ZWx5IGNvbW1hbmQpKSkpKSkKKwogKGRlZnVuIHByb2plY3QtcmVtZW1iZXItcHJvamVj dHMtdW5kZXIgKGRpciAmb3B0aW9uYWwgcmVjdXJzaXZlKQogICAiSW5kZXggYWxsIHByb2pl Y3RzIGJlbG93IGEgZGlyZWN0b3J5IERJUi4KIElmIFJFQ1VSU0lWRSBpcyBub24tbmlsLCBy ZWN1cnNlIGludG8gYWxsIHN1YmRpcmVjdG9yaWVzIHRvIGZpbmQKQEAgLTE4OTEsNyArMTkx OSw4IEBAIHByb2plY3Qtc3dpdGNoLWNvbW1hbmRzCiAgICAgKHByb2plY3QtZmluZC1yZWdl eHAgIkZpbmQgcmVnZXhwIikKICAgICAocHJvamVjdC1maW5kLWRpciAiRmluZCBkaXJlY3Rv cnkiKQogICAgIChwcm9qZWN0LXZjLWRpciAiVkMtRGlyIikKLSAgICAocHJvamVjdC1lc2hl bGwgIkVzaGVsbCIpKQorICAgIChwcm9qZWN0LWVzaGVsbCAiRXNoZWxsIikKKyAgICAocHJv amVjdC1hbnktY29tbWFuZCAiT3RoZXIiKSkKICAgIkFsaXN0IG1hcHBpbmcgY29tbWFuZHMg dG8gZGVzY3JpcHRpb25zLgogVXNlZCBieSBgcHJvamVjdC1zd2l0Y2gtcHJvamVjdCcgdG8g Y29uc3RydWN0IGEgZGlzcGF0Y2ggbWVudSBvZgogY29tbWFuZHMgYXZhaWxhYmxlIHVwb24g XCJzd2l0Y2hpbmdcIiB0byBhbm90aGVyIHByb2plY3QuCg== --------------FMFjdA4hZRIKy0ABIQ4BfA7W--