I'm a bit confused when writing code using the VC interface. After executing the following commands in the shell (committing a dummy file ~/test/file in a fresh git repo ~/test):

mkdir test
cd test
git init
touch file
git add file
git commit -am "test"

I end up in a situation in which Emacs (vc-state "~/test/file") evaluate to unregistered but (vc-registered "~/test/file") reports the converse as it evaluates to t. What's wrong?

1 Answer 1


Apparently, I'm supposed to be on the buffer. Hence, the following snippet

  (find-file-noselect "~/test/file") 
  (vc-state "~/test/file"))

is evaluated to up-to-date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.