Function: vc-buffer-sync
vc-buffer-sync is a byte-compiled function defined in
vc-dispatcher.el.gz.
Signature
(vc-buffer-sync &optional NOT-ESSENTIAL)
Documentation
Make sure the current buffer and its working file are in sync.
NOT-ESSENTIAL means it is okay to continue if the user says not to save.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-dispatcher.el.gz
(defun vc-buffer-sync (&optional not-essential)
"Make sure the current buffer and its working file are in sync.
NOT-ESSENTIAL means it is okay to continue if the user says not to save."
(let (missing)
(when (cond
((buffer-modified-p))
((not (file-exists-p buffer-file-name))
(setq missing t)))
(if (or vc-suppress-confirm
(y-or-n-p (format "Buffer %s %s; save it? "
(buffer-name)
(if missing
"is missing on disk"
"modified"))))
(save-buffer)
(unless not-essential
(error "Aborted"))))))