]> code.delx.au - gnu-emacs/commitdiff
Delete the old process in vc-setup-buffer
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 27 May 2015 23:16:00 +0000 (02:16 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 27 May 2015 23:28:56 +0000 (02:28 +0300)
* lisp/vc/vc-dispatcher.el (vc-setup-buffer): Delete the old
process here.
(vc-do-command): Rather than here (bug#20608).

lisp/vc/vc-dispatcher.el

index a2c1cba5fde5e472304f1619e7b4cc02f6e3f7e3..ec55867fcfe0ad007c294dfcb623d6089cb16a2d 100644 (file)
@@ -171,6 +171,12 @@ Another is that undo information is not kept."
   (let ((camefrom (current-buffer))
        (olddir default-directory))
     (set-buffer (get-buffer-create buf))
+    (let ((oldproc (get-buffer-process (current-buffer))))
+      ;; If we wanted to wait for oldproc to finish before doing
+      ;; something, we'd have used vc-eval-after.
+      ;; Use `delete-process' rather than `kill-process' because we don't
+      ;; want any of its output to appear from now on.
+      (when oldproc (delete-process oldproc)))
     (kill-all-local-variables)
     (set (make-local-variable 'vc-parent-buffer) camefrom)
     (set (make-local-variable 'vc-parent-buffer-name)
@@ -302,12 +308,6 @@ case, and the process object in the asynchronous case."
                  (eq buffer (current-buffer)))
        (vc-setup-buffer buffer))
       ;; If there's some previous async process still running, just kill it.
-      (let ((oldproc (get-buffer-process (current-buffer))))
-        ;; If we wanted to wait for oldproc to finish before doing
-        ;; something, we'd have used vc-eval-after.
-        ;; Use `delete-process' rather than `kill-process' because we don't
-        ;; want any of its output to appear from now on.
-        (when oldproc (delete-process oldproc)))
       (let ((squeezed (remq nil flags))
            (inhibit-read-only t)
            (status 0))