[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Stefan Monnier
Subject: bug#6870: Make vc-root-diff work in more modes
Date: Mon, 04 Jul 2011 14:13:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]