]> git.eshelyaron.com Git - emacs.git/commitdiff
* vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256).
authorBob Rogers <rogers@rgrjr.dyndns.org>
Sun, 10 Jul 2011 01:42:39 +0000 (21:42 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 10 Jul 2011 01:42:39 +0000 (21:42 -0400)
lisp/ChangeLog
lisp/vc/vc.el

index f5a6c1eeaf4c5e3b94be202bac8f6a3264f06581..40f96b056375a679b137a624df4c1e4304e0d52c 100644 (file)
@@ -1,3 +1,7 @@
+2011-07-10  Bob Rogers  <rogers@rgrjr.dyndns.org>
+
+       * vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256).
+
 2011-07-10  Chong Yidong  <cyd@stupidchicken.com>
 
        * window.el (display-buffer): Fix arguments to
index e3f3c1530432d7ef94214cdc64b5494b5ee59abd..796311f8f661f9bda81f90f78d727fbeaf529e28 100644 (file)
@@ -1605,10 +1605,13 @@ Return t if the buffer had changes, nil otherwise."
       ;; bindings are nicer for read only buffers. pcl-cvs does the
       ;; same thing.
       (setq buffer-read-only t)
-      (vc-exec-after `(vc-diff-finish ,(current-buffer) ',(when verbose
-                                                            messages)))
       ;; Display the buffer, but at the end because it can change point.
       (pop-to-buffer (current-buffer))
+      ;; The diff process may finish early, so call `vc-diff-finish'
+      ;; after `pop-to-buffer'; the former assumes the diff buffer is
+      ;; shown in some window.
+      (vc-exec-after `(vc-diff-finish ,(current-buffer)
+                                     ',(when verbose messages)))
       ;; In the async case, we return t even if there are no differences
       ;; because we don't know that yet.
       t)))