Subject: Re: bug#41974: 28.0.50; Some vc commands refuse to work when called on non-file buffer

From: Dmitry Gutov <[email-masked]>
Date: Mon, 22 Jun 2020 03:59:38 +0300

On 22.06.2020 01:51, Juri Linkov wrote:
> Strange, this patch has no effect, the same error remains.

Sorry, that was a brain fart.

How about this:

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 9b12d44978..6bb72d8976 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1074,11 +1074,11 @@ vc-deduce-fileset
        (progn                  ;FIXME: Why not `with-current-buffer'? 
--Stef.
  	(set-buffer vc-parent-buffer)
  	(vc-deduce-fileset not-state-changing allow-unregistered 
state-model-only-files)))
-     ((and (derived-mode-p 'log-view-mode)
+     ((and (not buffer-file-name)
  	   (setq backend (vc-responsible-backend default-directory)))
        (list backend nil))
       ((not buffer-file-name)
-       (error "Buffer %s is not associated with a file" (buffer-name)))
+       (error "Buffer %s is not recognized by any VC backend" 
(buffer-name)))
       ((and allow-unregistered (not (vc-registered buffer-file-name)))
        (if state-model-only-files
  	  (list (vc-backend-for-registration (buffer-file-name))