Function: vc-before-save

vc-before-save is a byte-compiled function defined in vc-hooks.el.gz.

Signature

(vc-before-save)

Documentation

Function to be called by basic-save-buffer (in files.el).

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-hooks.el.gz
(defun vc-before-save ()
  "Function to be called by `basic-save-buffer' (in files.el)."
  ;; If the file on disk is still in sync with the repository,
  ;; and version backups should be made, copy the file to
  ;; another name.  This enables local diffs and local reverting.
  (let ((file buffer-file-name)
        backend)
    (ignore-errors               ;Be careful not to prevent saving the file.
      (unless (file-exists-p file)
        (vc-file-clearprops file))
      (and (setq backend (vc-backend file))
           (vc-up-to-date-p file)
           (eq (vc-checkout-model backend (list file)) 'implicit)
           (vc-call-backend backend 'make-version-backups-p file)
           (vc-make-version-backup file)))))