In batch mode vc related commands doesn't work as expected. In editor mode it partially works, if we do a vc--state before we do vc-state it gives correct state and a 'vc-recompute-state' gives correct state in any order. I verified the latest Emacs CVS source and the behavior is still same. It works fine with vc version shipped with Emacs v21.3. *Problem *Illustration: $ cvs status myfile.sh|grep Status File: myfile.sh Status: Needs Patch $ $ cat get-vc-state.el (require 'vc-cvs) (require 'vc) (message "%s" (emacs-version)) (if (> emacs-major-version 21) (message "%s" (vc-recompute-state "/tmp/myfile.sh")) (message "%s" (vc-state "/tmp/myfile.sh"))) (message "%s" (vc-cvs-state "/tmp/myfile.sh")) (message "%s" (vc-state "/tmp/myfile.sh")) $ $ emacs-22.1 -batch -l get-vc-state.el GNU Emacs 22.1.1 (i386-pc-solaris2.10, GTK+ Version 2.4.9) of 2007-09-27 on sx86qa3.nyc.deshaw.com up-to-date up-to-date up-to-date $ emacs-21.3 -batch -l get-vc-state.el GNU Emacs 21.3.1 (i386-pc-solaris2.10, Motif Version 2.1.0) of 2005-05-14 on sx86qa1.nyc.deshaw.com up-to-date needs-patch needs-patch $