GNU bug report logs - #41974
28.0.50; Some vc commands refuse to work when called on non-file buffer

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 21 Jun 2020 00:00:02 UTC

Severity: normal

Tags: fixed

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 41974 <at> debbugs.gnu.org
Subject: bug#41974: 28.0.50; Some vc commands refuse to work when called on non-file buffer
Date: Tue, 23 Jun 2020 02:38:39 +0300
> 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))

Thanks for finding the right place to fix, and it should also fix all
other vc commands that failed on non-file buffers.

>       ((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"

It seems this code is not necessary anymore because before this code
gets executed, vc-responsible-backend already signals its error
"No VC backend is responsible for file".




This bug report was last modified 5 years and 20 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.