From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#67171: 30.0.50; (At least) some VC commands fail with project-prefix-or-any-command Date: Wed, 06 Dec 2023 15:09:47 +0000 Message-ID: <87zfyne5ac.fsf@melete.silentflame.com> References: <87y1f0cwbj.fsf@melete.silentflame.com> <874jgwff35.fsf@melete.silentflame.com> <90011c72-b18f-5868-2430-66eee97f454e@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12901"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67171@debbugs.gnu.org, sbaugh@catern.com, juri@linkov.net To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 06 16:11:18 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 1rAtYS-00034L-5L for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Dec 2023 16:11:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAtY8-0007JO-Px; Wed, 06 Dec 2023 10:10:56 -0500 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 1rAtY5-0007IC-5A for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 10:10:53 -0500 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 1rAtY2-0004UZ-5R for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 10:10:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rAtYD-0006JK-U3 for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 10:11:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Dec 2023 15:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67171 X-GNU-PR-Package: emacs Original-Received: via spool by 67171-submit@debbugs.gnu.org id=B67171.170187541124186 (code B ref 67171); Wed, 06 Dec 2023 15:11:01 +0000 Original-Received: (at 67171) by debbugs.gnu.org; 6 Dec 2023 15:10:11 +0000 Original-Received: from localhost ([127.0.0.1]:40181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAtXO-0006I2-JW for submit@debbugs.gnu.org; Wed, 06 Dec 2023 10:10:10 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:59221) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAtXL-0006He-Gp for 67171@debbugs.gnu.org; Wed, 06 Dec 2023 10:10:08 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 3434B5C027F; Wed, 6 Dec 2023 10:09:50 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 06 Dec 2023 10:09:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; 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=fm3; t=1701875390; x= 1701961790; bh=If2MbRWpdk7Ssu0cHLGVUNn7P1KWy7M2v9tL6ze+o0g=; b=C cO7reibMRbzq4TSr3EzRxUCIqLW7E0qubNWRFLQschBoWsBiCgyx/hWgSfNBiHwJ Soiq/4fq2/uGp7gpXAKNWyJkteB9/aRJ95rWSI/1t7MNkAV8HljC3i0gut3uOwO5 DjZ7fm8ROfDpeR7ACVga4ZuXGvpJtufvWJUZLs3K3x7aq7REv/qTwvP2efxH6cLO zzVJS+sj6kY0pxRVo+oeOlCmPYkJrSAGq5P8YSjselLViGJwDpT0tY6BIneOWevd KtLA71FDJvXCN8RU25WYVlFwFJJTHSVh8D8UNFW5AozY5sOVaXqZLsDmfW35j3o0 EE7dI8tlNqSUArZjxi1SA== 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=fm1; t=1701875390; x=1701961790; bh=If2MbRWpdk7Ss u0cHLGVUNn7P1KWy7M2v9tL6ze+o0g=; b=D7kUYV/xjmHOBfp4fnPSSyNNDlOsD EN9XmmuVGTckHk4/3PHnfs3xXbEx728mZqJeKU7EJpYg2pFc6FOqjJdwUomfHFyA rfuTfCM6wg8Y0ZjXSRsM5nrKayGK1rn4plKtRaMMm0ntffyIxGlCMf3+i5vZ8Q+j q4CFP/uizoM+kU4NALPjiWCt7kM16lfELwW3+YHiqDSFZwbuH3DNi0AH3+QYjuJ0 coERyzM6QPKWYopW9I16F1h4iVwfksqF3IIkVKrvkJZFYMKuuBZxsktK4HylS59G wzpGvxiWdYfnHRTOU3P4qRqb97aJvDLjMZ1QorlRwwRKMDlQ4qx65wjWA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudektddgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffffkfgggtgesthdttddttdertdenucfhrhhomhepufgvrghn ucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpedtffdvffeuleeuvdetkedvveehgfehvdegvefghfevudek geegleevgeejkeetkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Feedback-ID: i23c04076:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Dec 2023 10:09:49 -0500 (EST) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 3399F7EDF76; Wed, 6 Dec 2023 15:09:47 +0000 (GMT) In-Reply-To: <90011c72-b18f-5868-2430-66eee97f454e@gutov.dev> (Dmitry Gutov's message of "Wed, 6 Dec 2023 02:26:12 +0200") 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:275603 Archived-At: Hello, On Wed 06 Dec 2023 at 02:26am +02, Dmitry Gutov wrote: > On 06/12/2023 00:40, Sean Whitton wrote: >> Alright, I've bisected it. After step 3, additionally eval this form: >> (define-key project-prefix-map "L" #'vc-print-root-log) >> I have this because I want to be able to type just L instead of C-x v L. >> That doesn't work -- possibly not a bug -- but surely adding that >> binding shouldn't affect C-x v L, at least? > > All right, the full scenario is unexpected, but otherwise it's a documented > behavior, see the docstring for 'project-any-command'. Thanks, I see what you mean. > We discussed the possibility of the override in the other way (in > bug#63648, which resulted in this command), but not an opt-out for > commands in project-prefix-map, yet. > > So... something like this? > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index a81bb63fba4..feef7ba5248 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -1861,9 +1861,10 @@ project-any-command > (when command > ;; We could also check the command name against "\\`project-", > ;; and/or (get command 'project-command). > - (map-keymap > - (lambda (_evt cmd) (if (eq cmd command) (setq found t))) > - project-prefix-map) > + (unless (get command 'project-switch-with-default-directory) > + (map-keymap > + (lambda (_evt cmd) (if (eq cmd command) (setq found t))) > + project-prefix-map)) > (if found > (let ((project-current-directory-override root)) > (call-interactively command)) > > > Combined with > > (put 'vc-print-root-log 'project-switch-with-default-directory t) > > somewhere in your init script. > > The alternative would be tagging all project-related commands. Even if we also > check for the 'project-' prefix in command's name, the user-defined commands > using the project API will be affected (I don't know for how many it would be > a problem, but still). This solution makes sense. We definitely want the user to have a way to tag additional commands. But couldn't we pre-tag some, like this one, for example? It is difficult to think of wanting to not have this one tagged. And the user could always remove the tag in their init. -- Sean Whitton