all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: andrea crotti <andrea.crotti.0@gmail.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>,
	Dmitry Gutov <dgutov@yandex.ru>
Subject: Re: No VC backend is responsible for
Date: Thu, 21 May 2015 11:55:06 +0200	[thread overview]
Message-ID: <87iobm9rwl.fsf@gnu.org> (raw)
In-Reply-To: <CAF_E5JYsKVbpK4=oZ6S4ivwwa1=CZZMQzOA5U=Fa16T7EKVNfA@mail.gmail.com> (andrea crotti's message of "Thu, 21 May 2015 10:41:35 +0100")

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



  reply	other threads:[~2015-05-21  9:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21  9:02 No VC backend is responsible for andrea crotti
2015-05-21  9:22 ` Dmitry Gutov
2015-05-21  9:41   ` andrea crotti
2015-05-21  9:55     ` Tassilo Horn [this message]
2015-05-21 10:25       ` andrea crotti
2015-05-21 10:31         ` Dmitry Gutov
2015-05-21 10:32         ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iobm9rwl.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=andrea.crotti.0@gmail.com \
    --cc=dgutov@yandex.ru \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.