Function: vc-resynch-buffer
vc-resynch-buffer is a byte-compiled function defined in
vc-dispatcher.el.gz.
Signature
(vc-resynch-buffer FILE &optional KEEP NOQUERY RESET-VC-INFO)
Documentation
If FILE is currently visited, resynch its buffer.
If NOQUERY is unless-modified then silently skip reverting or
unvisiting if the buffer is modified. Any other non-nil value inhibits
getting confirmation before reverting. NOQUERY should be a non-nil
value other than unless-modified only if it is known that the only
difference between the buffer and the file is due to modifications by
the dispatcher client code, rather than user editing.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-dispatcher.el.gz
(defun vc-resynch-buffer (file &optional keep noquery reset-vc-info)
"If FILE is currently visited, resynch its buffer.
If NOQUERY is `unless-modified' then silently skip reverting or
unvisiting if the buffer is modified. Any other non-nil value inhibits
getting confirmation before reverting. NOQUERY should be a non-nil
value other than `unless-modified' only if it is known that the only
difference between the buffer and the file is due to modifications by
the dispatcher client code, rather than user editing."
(if (equal buffer-file-name
(if (file-name-absolute-p file)
file
(expand-file-name file (vc-root-dir))))
(unless (and (eq noquery 'unless-modified)
(buffer-modified-p))
(vc-resynch-window file keep noquery reset-vc-info))
(if (file-directory-p file)
(vc-resynch-buffers-in-directory file keep noquery reset-vc-info)
(when-let* ((buffer (get-file-buffer file)))
(with-current-buffer buffer
(unless (and (eq noquery 'unless-modified)
(buffer-modified-p))
(vc-resynch-window file keep noquery reset-vc-info))))))
;; Try to avoid unnecessary work, a *vc-dir* buffer is only present
;; if this is true.
(when vc-dir-buffers
(vc-dir-resynch-file file)))