Function: vc-set-async-update

vc-set-async-update is a byte-compiled function defined in vc-dispatcher.el.gz.

Signature

(vc-set-async-update PROCESS-BUFFER)

Documentation

Set a vc-exec-after action appropriate to the current buffer.

This action will update the current buffer after the current asynchronous VC command has completed. PROCESS-BUFFER is the buffer for the asynchronous VC process.

If the current buffer is a VC Dir buffer, call vc-dir-refresh. If the current buffer is a Dired buffer, revert it.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-dispatcher.el.gz
(defun vc-set-async-update (process-buffer)
  "Set a `vc-exec-after' action appropriate to the current buffer.
This action will update the current buffer after the current
asynchronous VC command has completed.  PROCESS-BUFFER is the
buffer for the asynchronous VC process.

If the current buffer is a VC Dir buffer, call `vc-dir-refresh'.
If the current buffer is a Dired buffer, revert it."
  (let* ((buf (current-buffer))
	 (tick (buffer-modified-tick buf)))
    (cond
     ((derived-mode-p 'vc-dir-mode)
      (with-current-buffer process-buffer
	(vc-run-delayed
	 (if (buffer-live-p buf)
             (with-current-buffer buf
               (vc-dir-refresh))))))
     ((derived-mode-p 'dired-mode)
      (with-current-buffer process-buffer
	(vc-run-delayed
	 (and (buffer-live-p buf)
              (= (buffer-modified-tick buf) tick)
              (with-current-buffer buf
                (revert-buffer)))))))))