Function: vc-after-save

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

Signature

(vc-after-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-after-save ()
  "Function to be called by `basic-save-buffer' (in files.el)."
  ;; If the file in the current buffer is under version control,
  ;; up-to-date, and locking is not used for the file, set
  ;; the state to 'edited and redisplay the mode line.
  (let* ((file buffer-file-name)
         (backend (vc-backend file)))
    (cond
     ((null backend))
     ((eq (vc-checkout-model backend (list file)) 'implicit)
      ;; If the file was saved at the same time that it was
      ;; checked out, clear the checkout-time to avoid confusion.
      (if (time-equal-p
		 (vc-file-getprop file 'vc-checkout-time)
		 (file-attribute-modification-time (file-attributes file)))
	  (vc-file-setprop file 'vc-checkout-time nil))
      (if (vc-state-refresh file backend)
	  (vc-mode-line file backend)))
     ;; If we saved an unlocked file on a locking based VCS, that
     ;; file is not longer up-to-date.
     ((eq (vc-file-getprop file 'vc-state) 'up-to-date)
      (vc-file-setprop file 'vc-state nil)))
    ;; Resynch *vc-dir* buffers, if any are present.
    (when vc-dir-buffers
      (vc-dir-resynch-file file))))