(@pxref{Customizing VC}).
@end ifnottex
+@findex vc-refresh-state
+@findex vc-state-refresh
+ To update the VC state information for the file visited in the
+current buffer, use the command @code{vc-refresh-state}. This command
+is useful when you perform version control commands outside Emacs
+(e.g., from the shell prompt), or if you put the buffer's file under a
+different version control system, or remove it from version control
+entirely. A companion command @code{vc-state-refresh} does the same,
+but does not consider switching the version control system or removal
+from VC.
+
@menu
* Introduction to VC:: How version control works in general.
* VC Mode Line:: How the mode line shows version control status.
`json-pretty-print-buffer-ordered' pretty prints JSON objects with
object keys sorted alphabetically.
-** You can recompute the VC state of a file buffer with `M-x vc-refresh-state'
-
** Prog mode has some support for multi-mode indentation.
See `prog-indentation-context' and `prog-widen'.
*** The new command vc-region-history shows the log+diff of the active region.
++++
+*** You can refresh the VC state of a file buffer with `M-x vc-refresh-state'.
+This command is useful when you perform version control commands
+outside Emacs (e.g., from the shell prompt), or if you switch the VC
+back-end for the buffer's file, or remove it from version control.
+
*** New option `vc-annotate-background-mode' controls whether
the color range from `vc-annotate-color-map' is applied to the
background or to the foreground.
nil)
(defun vc-refresh-state ()
- "Activate or deactivate VC mode as appropriate."
+ "Refresh the VC state of the current buffer's file.
+
+This command is more thorough than `vc-state-refresh', in that it
+also supports switching a back-end or removing the file from VC.
+In the latter case, VC mode is deactivated for this buffer."
(interactive)
;; Recompute whether file is version controlled,
;; if user has killed the buffer and revisited.