Subject: Re: bug#6870: Make vc-root-diff work in more modes

From: Stefan Monnier <[email-masked]>
Date: Mon, 04 Jul 2011 14:13:42 -0400

>> (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
>> -		 ((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))))
>> rootdir working-revision)
>> (unless backend
>> (error "Buffer is not version controlled"))

> This looks very reasonable to me, but I'm not all that familiar with
> vc.el internals.  Does anybody else have any opinions on this?

It's only reasonable in buffers where default-directory is really
meaningful.  E.g. in *Help* or *info* it's likely not going to do you
much good.
So feel free to add more major modes (rather than just `dired'), but
I don't think using (vc-responsible-backend default-directory)
everywhere is a good idea.

        Stefan