GNU bug report logs - #6870
Make vc-root-diff work in more modes

Previous Next

Package: emacs;

Reported by: rogers-emacs <at> rgrjr.dyndns.org

Date: Tue, 17 Aug 2010 01:55:02 UTC

Severity: minor

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 6870 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: rogers-emacs <at> rgrjr.dyndns.org
Cc: 6870 <at> debbugs.gnu.org
Subject: Re: bug#6870: Make vc-root-diff work in more modes
Date: Tue, 25 Aug 2020 15:38:42 +0200
rogers-emacs <at> rgrjr.dyndns.org writes:

>    It makes sense to me that vc-root-diff uses "(vc-responsible-backend
> default-directory)" when in a dired-mode buffer.  But since vc-root-diff
> is not at all about the current buffer, why not also make that the
> default for shell-mode, diff-mode, or any of the other modes for
> non-version-controlled buffers that may be generated in a working copy?

[...]

> -		 ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
> -		 (vc-mode (vc-backend buffer-file-name))))
> +		 (vc-mode (vc-backend buffer-file-name))
> +		 (t (vc-responsible-backend default-directory))))

This has been extended somewhat over the years:

(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)
        ;; Maybe we could even use comint-mode rather than shell-mode?
	((derived-mode-p 'dired-mode 'shell-mode 'compilation-mode)
	 (ignore-errors (vc-responsible-backend default-directory)))
	(vc-mode (vc-backend buffer-file-name))))

So we still don't do this in all buffers, but since there's some issues
with that, I think this works well now.  So I'm closing this bug
report.  If there's more to be done here, respond to the debbugs address
and we'll reopen the report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 269 days ago.

Previous Next


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