[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: No VC backend is responsible for
From: |
Tassilo Horn |
Subject: |
Re: No VC backend is responsible for |
Date: |
Thu, 21 May 2015 11:55:06 +0200 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) |
andrea crotti <andrea.crotti.0@gmail.com> writes:
> Yes true thanks, I thought Helm could be the issue but it doesn't work.
> Actually the problems seems to be my code:
> (defun ca-is-version-control-file ()
> "Return nil unless the file is in the git files"
> (if (vc-working-revision (buffer-file-name))
> (auto-revert-mode t)))
>
> (add-hook 'find-file-hook 'ca-is-version-control-file)
>
> Makes sense, it's just a bit surprising because I haven't touched this
> code for a long time and it used to work..
> Probably checking if the file is under vc using something that is not
> vc-workiing-revision would do the trick..
I think (vc-backend (buffer-file-name)) should work. Its docs say it
returns nil if the file is not registered with a VCS.
Bye,
Tassilo