GNU bug report logs - #1256
Race condition in vc-diff

Previous Next

Package: emacs;

Reported by: Bob Rogers <rogers-emacs <at> rgrjr.dyndns.org>

Date: Sat, 25 Oct 2008 22:40:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 1256 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Bob Rogers <rogers-emacs <at> rgrjr.dyndns.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 1256 <at> debbugs.gnu.org
Subject: Re: bug#1256: Race condition in vc-diff
Date: Sat, 25 Oct 2008 23:45:39 -0400
   From: Stefan Monnier <monnier <at> iro.umontreal.ca>
   Date: Sat, 25 Oct 2008 22:31:18 -0400

   >    If you visit this file and do "C-x v =" in a single-window frame that
   > is more than about 30 lines tall, and if the backend diff command is
   > fast enough, the diff window will remain half the size of the screen,
   > rather than being shrunk to fit the buffer.  This is because
   > vc-exec-after finds that the buffer process has already finished, and
   > runs vc-diff-finish before the diff buffer has been made visible.  In
   > that case, vc-diff-finish assumes that the user has already buried it.

   >    I am not a big fan of this shrink-wrapping, but I do think vc-diff
   > ought to behave consistently (and it has worked this way for quite a
   > while now).  The attached patch is sufficient to fix it.

   As the comment indicates, this patch is not quite good enough because
   pop-to-buffer may change point.  We probably will need to manipulate
   point explicitly to work around the problem.  

Problem?  vc-diff-finish sets point in the diff buffer, so if it runs
immediately, it seems to me that it ought to override what pop-to-buffer
does.  But perhaps I don't understand what point-changing behavior you
mean.

   BTW you can make the "race-condition" deterministic by making the
   diff command synchronous (as is the case with the RCS backend, for
   example, where your problem should just *always* happen).

	   Stefan

It never occurred to me to try that.  However, the same argument would
seem to apply for (setq vc-disable-async-diff t), but that only makes
the bug appear intermittently for me, even with the identical test case.

					-- Bob




This bug report was last modified 13 years and 318 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.