From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#1256: Race condition in vc-diff Date: Sat, 25 Oct 2008 22:31:18 -0400 Message-ID: References: <18691.40605.633869.254120@rgrjr.rgrjr.dyndns.org> Reply-To: Stefan Monnier , 1256@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224989426 12461 80.91.229.12 (26 Oct 2008 02:50:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Oct 2008 02:50:26 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, 1256@emacsbugs.donarmstrong.com To: Bob Rogers Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 26 03:51:26 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ktviq-0003uU-Hh for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Oct 2008 03:51:20 +0100 Original-Received: from localhost ([127.0.0.1]:36967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ktvhk-0003OX-Cz for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Oct 2008 22:50:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ktvhg-0003Np-2h for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 22:50:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ktvhf-0003ND-0C for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 22:50:07 -0400 Original-Received: from [199.232.76.173] (port=47967 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ktvhe-0003N4-IT for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 22:50:06 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60369) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ktvhe-0000Ot-5Q for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 22:50:06 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9Q2o2i4013187; Sat, 25 Oct 2008 19:50:03 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m9Q2e4sM010943; Sat, 25 Oct 2008 19:40:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 26 Oct 2008 02:40:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1256 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12249882859620 (code B ref -1); Sun, 26 Oct 2008 02:40:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 26 Oct 2008 02:31:25 +0000 Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9Q2VMEd009613 for ; Sat, 25 Oct 2008 19:31:23 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:33615) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KtvMp-0001hR-SA for emacs-pretest-bug@gnu.org; Sat, 25 Oct 2008 22:28:36 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KtvPU-0003oV-2I for emacs-pretest-bug@gnu.org; Sat, 25 Oct 2008 22:31:20 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:7021) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KtvPT-0003oN-Qr for emacs-pretest-bug@gnu.org; Sat, 25 Oct 2008 22:31:19 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAH9zA0lFxLrB/2dsb2JhbACBdr4qg0+BDQ X-IronPort-AV: E=Sophos;i="4.33,486,1220241600"; d="scan'208";a="28865959" Original-Received: from 69-196-186-193.dsl.teksavvy.com (HELO pastel.home) ([69.196.186.193]) by ironport2-out.teksavvy.com with ESMTP; 25 Oct 2008 22:31:19 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id E637F8E6C; Sat, 25 Oct 2008 22:31:18 -0400 (EDT) In-Reply-To: <18691.40605.633869.254120@rgrjr.rgrjr.dyndns.org> (Bob Rogers's message of "Sat, 25 Oct 2008 18:33:01 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sat, 25 Oct 2008 22:50:07 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:21923 gmane.emacs.pretest.bugs:23310 Archived-At: > 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. 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