From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: 67171@debbugs.gnu.org, sbaugh@catern.com,
Sean Whitton <spwhitton@spwhitton.name>
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 [thread overview]
Message-ID: <86a5r1y8wm.fsf@mail.linkov.net> (raw)
In-Reply-To: <fc6b2400-a180-8cb1-a4c2-3d7e20484d6a@gutov.dev> (Dmitry Gutov's message of "Fri, 24 Nov 2023 14:27:56 +0200")
[-- Attachment #1: Type: text/plain, Size: 678 bytes --]
>>>>> 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:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vc-deduce-backend-nonvc-modes.patch --]
[-- Type: text/x-diff, Size: 1326 bytes --]
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))))
next prev parent reply other threads:[~2023-11-25 18:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 13:13 bug#67171: 30.0.50; (At least) some VC commands fail with project-prefix-or-any-command Sean Whitton
2023-11-20 2:17 ` Dmitry Gutov
2023-11-23 15:21 ` Sean Whitton
2023-11-23 17:20 ` Juri Linkov
2023-11-23 22:21 ` Dmitry Gutov
2023-11-24 7:46 ` Juri Linkov
2023-11-24 12:27 ` Dmitry Gutov
2023-11-25 18:39 ` Juri Linkov [this message]
2023-11-25 19:07 ` Dmitry Gutov
2023-11-25 19:10 ` Juri Linkov
2023-11-25 19:13 ` Dmitry Gutov
2023-11-25 19:13 ` Eli Zaretskii
2023-11-27 7:39 ` Juri Linkov
2023-11-23 22:30 ` Dmitry Gutov
2023-12-05 22:40 ` Sean Whitton
2023-12-06 0:26 ` Dmitry Gutov
2023-12-06 15:09 ` Sean Whitton
2023-12-07 0:10 ` Dmitry Gutov
2023-12-07 11:23 ` Sean Whitton
2023-12-08 20:37 ` Dmitry Gutov
2023-12-08 21:29 ` Sean Whitton
2023-12-06 17:10 ` Juri Linkov
2023-12-07 0:01 ` Dmitry Gutov
2023-12-07 17:22 ` Juri Linkov
2023-12-07 17:34 ` Dmitry Gutov
2023-12-08 7:40 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86a5r1y8wm.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=67171@debbugs.gnu.org \
--cc=dmitry@gutov.dev \
--cc=sbaugh@catern.com \
--cc=spwhitton@spwhitton.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).