bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bo


From: Dmitry Gutov
Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted
Date: Wed, 27 May 2015 17:14:29 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0

On 05/26/2015 11:53 PM, Stefan Monnier wrote:

Hmm... so I guess in the case at hand, the issue is that the buffer is
setup (e.g. erased) before calling vc-do-command

Indeed, vc-git-print-log calls vc-setup-buffer.

But I think the real fix is in this direction: kill the process (and run
its sentinel) earlier, i.e. before setting up the buffer.

The reason why I think this is the better way forward, is that it lets
us run the sentinels in the normal way, so we don't need to worry about
what the sentinels might or might not do.

Good point, then the delayed code being unable to read the process status is irrelevant.

Any reservations about this patch?

diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index a2c1cba..ec55867 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -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))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]