From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Date: Mon, 25 May 2015 00:42:33 +0300 Message-ID: <556245C9.5040606@yandex.ru> References: <86d21weqsc.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1432503817 25151 80.91.229.3 (24 May 2015 21:43:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 May 2015 21:43:37 +0000 (UTC) Cc: 20608@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 24 23:43:23 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ywdg2-0007k6-Bv for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 May 2015 23:43:22 +0200 Original-Received: from localhost ([::1]:40920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywdg1-0001Q6-Jl for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 May 2015 17:43:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywdfn-0001A1-Q9 for bug-gnu-emacs@gnu.org; Sun, 24 May 2015 17:43:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ywdfj-0004gq-84 for bug-gnu-emacs@gnu.org; Sun, 24 May 2015 17:43:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywdfj-0004ge-4g for bug-gnu-emacs@gnu.org; Sun, 24 May 2015 17:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Ywdfi-0007Wz-En for bug-gnu-emacs@gnu.org; Sun, 24 May 2015 17:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 May 2015 21:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20608 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.143250377528936 (code B ref 20608); Sun, 24 May 2015 21:43:02 +0000 Original-Received: (at 20608) by debbugs.gnu.org; 24 May 2015 21:42:55 +0000 Original-Received: from localhost ([127.0.0.1]:54958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YwdfW-0007WZ-9E for submit@debbugs.gnu.org; Sun, 24 May 2015 17:42:54 -0400 Original-Received: from mail-wi0-f175.google.com ([209.85.212.175]:36089) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YwdfP-0007WI-TP for 20608@debbugs.gnu.org; Sun, 24 May 2015 17:42:48 -0400 Original-Received: by wizk4 with SMTP id k4so32420195wiz.1 for <20608@debbugs.gnu.org>; Sun, 24 May 2015 14:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=Fvqf1oOQqZBkPlgpTCsAk2EHmXJxZR2ZrIWJ9sbif8k=; b=eF6KJiEKkWI0XHmcIQTDI2F33opa3ISqKU9owjfZrStejOMfQFufC4TiCsQZH+hTD7 EmNi6AOdsRs28PitMhuqe4bVKHUXApXH/pcqWooIfLlHZK8Z4aSbXQOiGWYD8z95OLxy r5Eyz5HL+FpDHflBPiSos+UyAgfZ0WmpUDDcMaan8WTU/018dpurNNr7RSGsmgfEODVa S3xi/FRb1iofi4aSP/SCrIeKBuKgYbqEi4n4URR0j/QN8CpIT9pNSuSeTgXHyXNYuxcV v5H2TLFLAMJcdHyN4Cl/obfEa/bk0EKY6Aw+abXHuxX++IiGR6XPjnqL65mNs40qlYj5 nSAA== X-Received: by 10.180.7.169 with SMTP id k9mr26077268wia.70.1432503758282; Sun, 24 May 2015 14:42:38 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id o5sm8990501wia.0.2015.05.24.14.42.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 May 2015 14:42:38 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103142 Archived-At: On 05/19/2015 08:40 PM, Stefan Monnier wrote: >> It seems like a general problem, to be fixed either in vc-do-command (by >> unsetting the process sentinel before deleting the process), or in >> vc--process-sentinel. Here's the patch for the second option: > > Indeed, it's a general problem. Maybe handling it in vc-do-command > would be a good idea, but unsetting the process sentinel altogether > sounds a bit dangerous (the sentinel might also be used to clear the > ":running" annotation in the modeline and other such things). I think it's only dangerous if the sentinel is used to clean up some other buffer than the one where the process is running (vc-do-command will take care about the latter, and anyway it's launching a new process, so mode-line-process will be set either way). Do we know of the instances of the former? Doing it in vc--process-sentinel indeed seems more dangerous, because it'll preclude doing cleanup even when no new process is being launched. As far as the current (Show 2X entries) problem goes, we should've been able to use a more direct approach, and make the choice inside the delayed code, but unfortunately the buffer process is already nil in there. So, this doesn't work: diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 1bd04e1..88bd335 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2263,13 +2263,15 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)." ;; the major-mode. (pop-to-buffer buffer-name) (vc-run-delayed - (let ((inhibit-read-only t)) - (funcall setup-buttons-func backend files retval) - (shrink-window-if-larger-than-buffer) - (when goto-location-func - (funcall goto-location-func backend) - (setq vc-sentinel-movepoint (point))) - (set-buffer-modified-p nil))))) + (let ((inhibit-read-only t) + (proc (get-buffer-process buffer-name))) + (when (or (null proc) (eq (process-status proc) 'exit)) + (funcall setup-buttons-func backend files retval) + (shrink-window-if-larger-than-buffer) + (when goto-location-func + (funcall goto-location-func backend) + (setq vc-sentinel-movepoint (point))) + (set-buffer-modified-p nil)))))) (defun vc-incoming-outgoing-internal (backend remote-location buffer-name type) (vc-log-internal-common