From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.bugs Subject: bug#1256: Race condition in vc-diff Date: Sat, 25 Oct 2008 23:45:39 -0400 Message-ID: <18691.59363.668687.48867@rgrjr.rgrjr.dyndns.org> References: <18691.40605.633869.254120@rgrjr.rgrjr.dyndns.org> Reply-To: Bob Rogers , 1256@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1224994219 21245 80.91.229.12 (26 Oct 2008 04:10:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Oct 2008 04:10:19 +0000 (UTC) Cc: 1256@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 26 05:11:20 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 1KtwyF-0008JW-G5 for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Oct 2008 05:11:19 +0100 Original-Received: from localhost ([127.0.0.1]:58262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ktwx9-0004q1-Jn for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Oct 2008 00:10:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ktwx6-0004pq-Ai for bug-gnu-emacs@gnu.org; Sun, 26 Oct 2008 00:10:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ktwx4-0004pS-RS for bug-gnu-emacs@gnu.org; Sun, 26 Oct 2008 00:10:08 -0400 Original-Received: from [199.232.76.173] (port=55603 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ktwx4-0004pO-Ld for bug-gnu-emacs@gnu.org; Sun, 26 Oct 2008 00:10:06 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:54251) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ktwx4-000277-3Z for bug-gnu-emacs@gnu.org; Sun, 26 Oct 2008 00:10: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 m9Q4A206001068; Sat, 25 Oct 2008 21:10:02 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m9Q3t40Q029383; Sat, 25 Oct 2008 20:55:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Bob Rogers Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 26 Oct 2008 03:55: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 1256-submit@emacsbugs.donarmstrong.com id=B1256.122499274428066 (code B ref 1256); Sun, 26 Oct 2008 03:55:04 +0000 Original-Received: (at 1256) by emacsbugs.donarmstrong.com; 26 Oct 2008 03:45:44 +0000 Original-Received: from alexandria.modulargenetics.com (modulargenetics.com [65.211.19.210]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9Q3jf61028060 for <1256@emacsbugs.donarmstrong.com>; Sat, 25 Oct 2008 20:45:42 -0700 Original-Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net [66.30.196.77]) by alexandria.modulargenetics.com (Postfix on SuSE Linux) with ESMTP id A5CF3640D2 for <1256@emacsbugs.donarmstrong.com>; Sat, 25 Oct 2008 23:45:40 -0400 (EDT) Original-Received: (qmail 26078 invoked by uid 89); 26 Oct 2008 03:45:40 -0000 Original-Received: from unknown (HELO rgr.rgrjr.dyndns.org) (192.168.57.1) by home with SMTP; 26 Oct 2008 03:45:40 -0000 Original-Received: by rgr.rgrjr.dyndns.org (Postfix, from userid 500) id 056FC4B993; Sat, 25 Oct 2008 23:45:39 -0400 (EDT) In-Reply-To: X-Mailer: VM 7.19 under Emacs 23.0.60.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 26 Oct 2008 00:10:08 -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:21925 Archived-At: From: Stefan Monnier 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