Function: vc-do-async-command

vc-do-async-command is a byte-compiled function defined in vc-dispatcher.el.gz.

Signature

(vc-do-async-command BUFFER ROOT COMMAND &rest ARGS)

Documentation

Run COMMAND asynchronously with ARGS, displaying the result.

Send the output to BUFFER, which should be a buffer or the name of a buffer, which is created. ROOT should be the directory in which the command should be run. Display the buffer in some window, but don't select it.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-dispatcher.el.gz
(defun vc-do-async-command (buffer root command &rest args)
  "Run COMMAND asynchronously with ARGS, displaying the result.
Send the output to BUFFER, which should be a buffer or the name
of a buffer, which is created.
ROOT should be the directory in which the command should be run.
Display the buffer in some window, but don't select it."
  (let* ((dir default-directory)
	 (inhibit-read-only t)
	 window new-window-start)
    (setq buffer (get-buffer-create buffer))
    (if (get-buffer-process buffer)
	(error "Another VC action on %s is running" root))
    (with-current-buffer buffer
      (setq default-directory root)
      (goto-char (point-max))
      (unless (eq (point) (point-min))
	(insert "\n"))
      (setq new-window-start (point))
      (insert "Running \"" command)
      (dolist (arg args)
	(insert " " arg))
      (insert "\"...\n")
      ;; Run in the original working directory.
      (let ((default-directory dir))
	(apply #'vc-do-command t 'async command nil args)))
    (setq window (display-buffer buffer))
    (if window
	(set-window-start window new-window-start))
    buffer))