From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#67171: 30.0.50; (At least) some VC commands fail with project-prefix-or-any-command Date: Sat, 25 Nov 2023 20:39:37 +0200 Organization: LINKOV.NET Message-ID: <86a5r1y8wm.fsf@mail.linkov.net> References: <87y1f0cwbj.fsf@melete.silentflame.com> <87a5r4bim6.fsf@melete.silentflame.com> <867cm8z8rt.fsf@mail.linkov.net> <197e0d54-dab9-e7cf-e78d-ea7384735f1b@gutov.dev> <86il5rlj01.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12669"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 67171@debbugs.gnu.org, sbaugh@catern.com, Sean Whitton To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 25 19:44:22 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 1r6xde-00036C-K5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Nov 2023 19:44:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6xdI-0003jK-HR; Sat, 25 Nov 2023 13:44:00 -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 1r6xdG-0003fx-HH for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 13:43:59 -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 1r6xdG-0000b2-92 for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 13:43:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6xdK-0005eb-OV for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 13:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Nov 2023 18:44:02 +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.170093781521683 (code B ref 67171); Sat, 25 Nov 2023 18:44:02 +0000 Original-Received: (at 67171) by debbugs.gnu.org; 25 Nov 2023 18:43:35 +0000 Original-Received: from localhost ([127.0.0.1]:40287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6xct-0005df-5c for submit@debbugs.gnu.org; Sat, 25 Nov 2023 13:43:35 -0500 Original-Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]:57041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6xcj-0005cr-Gx for 67171@debbugs.gnu.org; Sat, 25 Nov 2023 13:43:26 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 11760240003; Sat, 25 Nov 2023 18:43:11 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Fri, 24 Nov 2023 14:27:56 +0200") X-GND-Sasl: juri@linkov.net 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:275011 Archived-At: --=-=-= Content-Type: text/plain >>>>> As an aside, it doesn't seem good that whether or not step four prompts >>>>> you for a directory depends on whether the current buffer happens to be >>>>> visiting a file or not. Can we improve that, or is it inherent to the >>>>> design of the new feature? >>>> This was improved recently in bug#67145, so now you can set >>>> 'vc-deduce-backend-nonvc-modes' to nil to avoid this prompt. >>>> I'm not sure if nil should be the default value. >>> I wonder if the "deduce in all modes" value should be t rather than nil. >> Good idea since nil could be used to disable deduction completely. >> Then maybe it should be defcustom? > > Why not. Maybe something like this: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=vc-deduce-backend-nonvc-modes.patch diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 1bd9ecb2193..bde22536d1f 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1071,19 +1071,23 @@ log-edit-vc-backend (defvar diff-vc-backend) (defvar diff-vc-revisions) -;; Maybe we could even use comint-mode rather than shell-mode? -(defvar vc-deduce-backend-nonvc-modes +(defcustom vc-deduce-backend-nonvc-modes + ;; Maybe we could even use comint-mode rather than shell-mode? '(dired-mode shell-mode eshell-mode compilation-mode) "List of modes not supported by VC where backend should be deduced. In these modes the backend is deduced based on `default-directory'. -When nil, the backend is deduced in all modes.") +When t, the backend is deduced in all modes." + :type '(choice (const :tag "None" nil) + hook + (const :tag "All" t)) + :version "30.1") (defun vc-deduce-backend () (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) ((derived-mode-p 'log-view-mode) log-view-vc-backend) ((derived-mode-p 'log-edit-mode) log-edit-vc-backend) ((derived-mode-p 'diff-mode) diff-vc-backend) - ((or (null vc-deduce-backend-nonvc-modes) + ((or (eq vc-deduce-backend-nonvc-modes t) (derived-mode-p vc-deduce-backend-nonvc-modes)) (ignore-errors (vc-responsible-backend default-directory))) (vc-mode (vc-backend buffer-file-name)))) --=-=-=--