From unknown Mon Aug 18 14:22:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 May 2015 11:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20608 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 20608@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.143203584524210 (code B ref -1); Tue, 19 May 2015 11:45:03 +0000 Received: (at submit) by debbugs.gnu.org; 19 May 2015 11:44:05 +0000 Received: from localhost ([127.0.0.1]:49648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YufwK-0006IQ-Ey for submit@debbugs.gnu.org; Tue, 19 May 2015 07:44:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48546) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YufwI-0006Hn-4m for submit@debbugs.gnu.org; Tue, 19 May 2015 07:44:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YufwB-0007p4-QG for submit@debbugs.gnu.org; Tue, 19 May 2015 07:43:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YufwB-0007p0-N7 for submit@debbugs.gnu.org; Tue, 19 May 2015 07:43:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YufwA-0004ly-CQ for bug-gnu-emacs@gnu.org; Tue, 19 May 2015 07:43:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yufw5-0007oD-DH for bug-gnu-emacs@gnu.org; Tue, 19 May 2015 07:43:54 -0400 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:33426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yufw5-0007mH-6m for bug-gnu-emacs@gnu.org; Tue, 19 May 2015 07:43:49 -0400 Received: by wgjc11 with SMTP id c11so14523556wgj.0 for ; Tue, 19 May 2015 04:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=gjvu95S80bTuAMQj3Vo8r+/YNSKaI5yKvQr7vpQsqLI=; b=dKX1rzjKEWcGpVDTbxEjudnJ0MO9lenh2drdBtE+Vlw8DVJYKyRiFJhWDI5QWVw5gk Hfaog4r5ea+CG/HREpZzTqplOFt+CejYt2beWvCWfZE2QtRSN5MKZF/A3yclnGqyavX2 EAaNXe9cTuTJGS6bbNf7Qx456MpolYaoOVRlMqj2XsriDWJw2aGRTprqK0imAk9ySWU0 4Acb3qWAdyahxeuQIxh9ZS5ahTnxggQwVbNfzzYAg03Zfq8Ea3L2HaBYRl+pooAVaiqB Ni4E1lLx1QiklZD+3niqWpGEtGEYu0B2GFJ1DN8X2yn+z2WQttYCLRiIYdMJhTEEzmaL NhPw== X-Received: by 10.180.88.72 with SMTP id be8mr31138007wib.45.1432035818155; Tue, 19 May 2015 04:43:38 -0700 (PDT) Received: from axl ([82.102.93.54]) by mx.google.com with ESMTPSA id kc4sm21426498wjc.2.2015.05.19.04.43.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2015 04:43:34 -0700 (PDT) From: Dmitry Gutov Date: Tue, 19 May 2015 14:43:31 +0300 Message-ID: <86d21weqsc.fsf@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Tags: patch 1. Visit lisp/vc/vc-dispatcher.el (the important part being that it's a file with long history). 2. Press C-x v l, see the print-log buffer pop up, with [waiting ...]. 3. Press g before the process finishes running. See the window shrink and "Show 2X entries Show unlimited entries" appear at the top (it will also get added at the bottom when the process finishes). 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: diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index a2c1cba..d6b50b7 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -183,35 +183,36 @@ Another is that undo information is not kept." (defvar vc-sentinel-movepoint) ;Dynamically scoped. (defun vc--process-sentinel (p code) - (let ((buf (process-buffer p))) + (let ((buf (process-buffer p)) + (status (process-status p))) ;; Impatient users sometime kill "slow" buffers; check liveness ;; to avoid "error in process sentinel: Selecting deleted buffer". (when (buffer-live-p buf) (with-current-buffer buf (setq mode-line-process - (let ((status (process-status p))) - ;; Leave mode-line uncluttered, normally. - (unless (eq 'exit status) - (format " (%s)" status)))) - (let (vc-sentinel-movepoint - (m (process-mark p))) - ;; Normally, we want async code such as sentinels to not move point. - (save-excursion - (goto-char m) - ;; Each sentinel may move point and the next one should be run - ;; at that new point. We could get the same result by having - ;; each sentinel read&set process-mark, but since `cmd' needs - ;; to work both for async and sync processes, this would be - ;; difficult to achieve. - (vc-exec-after code) - (move-marker m (point))) - ;; But sometimes the sentinels really want to move point. - (when vc-sentinel-movepoint - (let ((win (get-buffer-window (current-buffer) 0))) - (if (not win) - (goto-char vc-sentinel-movepoint) - (with-selected-window win - (goto-char vc-sentinel-movepoint)))))))))) + ;; Leave mode-line uncluttered, normally. + (unless (eq 'exit status) + (format " (%s)" status))) + (unless (eq 'signal status) + (let (vc-sentinel-movepoint + (m (process-mark p))) + ;; Normally, we want async code such as sentinels to not move point. + (save-excursion + (goto-char m) + ;; Each sentinel may move point and the next one should be run + ;; at that new point. We could get the same result by having + ;; each sentinel read&set process-mark, but since `cmd' needs + ;; to work both for async and sync processes, this would be + ;; difficult to achieve. + (vc-exec-after code) + (move-marker m (point))) + ;; But sometimes the sentinels really want to move point. + (when vc-sentinel-movepoint + (let ((win (get-buffer-window (current-buffer) 0))) + (if (not win) + (goto-char vc-sentinel-movepoint) + (with-selected-window win + (goto-char vc-sentinel-movepoint))))))))))) (defun vc-set-mode-line-busy-indicator () (setq mode-line-process From unknown Mon Aug 18 14:22:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 May 2015 13:02: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 To: Dmitry Gutov , 20608@debbugs.gnu.org Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.143204050731494 (code B ref 20608); Tue, 19 May 2015 13:02:02 +0000 Received: (at 20608) by debbugs.gnu.org; 19 May 2015 13:01:47 +0000 Received: from localhost ([127.0.0.1]:49720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yuh9W-0008Bu-Dc for submit@debbugs.gnu.org; Tue, 19 May 2015 09:01:46 -0400 Received: from mout.gmx.net ([212.227.15.18]:65099) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yuh9P-0008Bb-C4 for 20608@debbugs.gnu.org; Tue, 19 May 2015 09:01:44 -0400 Received: from [178.191.136.43] ([178.191.136.43]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0Lq9se-1ZPc7h0maO-00dkAn; Tue, 19 May 2015 15:01:33 +0200 Message-ID: <555B3428.4030201@gmx.at> Date: Tue, 19 May 2015 15:01:28 +0200 From: martin rudalics MIME-Version: 1.0 References: <86d21weqsc.fsf@yandex.ru> In-Reply-To: <86d21weqsc.fsf@yandex.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:KZD7Qx419bfTix5g0WCuVvgtNTDeBjXyUrtd3j1ncqIwd8RUpTY uhZOAtSNedlcCC1d88K2FthwmCNZyx02QoUcEaUuAUf4YLXaa2Ur5VsA2V1d6SeUThYRCkk 6JQjunGTtuXsFBgguUq1DWqsYfzNJ7U+ctTRH4HuufqiQA4ocDA4cAvyKFLVt+ZIXh10wH0 qcCb35epaLHr4CXZapYJA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > + (if (not win) > + (goto-char vc-sentinel-movepoint) > + (with-selected-window win > + (goto-char vc-sentinel-movepoint))))))))))) How about (if win (set-window-point win vc-sentinel-movepoint) (goto-char vc-sentinel-movepoint)) instead? martin From unknown Mon Aug 18 14:22:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 May 2015 13:04:01 +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 To: martin rudalics , 20608@debbugs.gnu.org Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.143204063831697 (code B ref 20608); Tue, 19 May 2015 13:04:01 +0000 Received: (at 20608) by debbugs.gnu.org; 19 May 2015 13:03:58 +0000 Received: from localhost ([127.0.0.1]:49724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YuhBd-0008FA-Ba for submit@debbugs.gnu.org; Tue, 19 May 2015 09:03:57 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:36036) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YuhBa-0008Ew-Jw for 20608@debbugs.gnu.org; Tue, 19 May 2015 09:03:55 -0400 Received: by wgbgq6 with SMTP id gq6so17079571wgb.3 for <20608@debbugs.gnu.org>; Tue, 19 May 2015 06:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=FnwEVZR8ByzDkKMbj1A1cwN3QJp+PEj+jZr6uwx1O2c=; b=inAv/9sGDtOui4bYo6IPDwONpRv+XTHFqS0BNMFJLYnzh/EWQagMgoC+Gwf8HrdR7h ih0ssDT3p7SVkZA1jwka4jNISlsUmDPSWVlViIfzeKG+yxbeSh5qqF1wTVHmpzPeJxFZ gn//J441xYTNG3LCVpKnUh8H7QlF5WcWEr/yzYFQS2lrc7bvz543IDQHSr7gU0Lt8y2m yzHL9w8RqNPTYUDN5NjwXOZZT23bbduKcNHPFK+0EMyy2Wb73wvf+cBy64tvMZOW83LM GPqzp2QAAV3Gjzjb9ZjTqXpazHPoYIJioiQfs73ukFRyRgPiSlALptJSOP5zO82Yca1l E0BA== X-Received: by 10.180.83.229 with SMTP id t5mr32128879wiy.82.1432040628834; Tue, 19 May 2015 06:03:48 -0700 (PDT) Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id ex2sm21735767wjd.28.2015.05.19.06.03.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2015 06:03:48 -0700 (PDT) References: <86d21weqsc.fsf@yandex.ru> <555B3428.4030201@gmx.at> From: Dmitry Gutov Message-ID: <555B34B1.3040202@yandex.ru> Date: Tue, 19 May 2015 16:03:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 In-Reply-To: <555B3428.4030201@gmx.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 05/19/2015 04:01 PM, martin rudalics wrote: > > + (if (not win) > > + (goto-char vc-sentinel-movepoint) > > + (with-selected-window win > > + (goto-char vc-sentinel-movepoint))))))))))) > > How about > > (if win > (set-window-point win vc-sentinel-movepoint) > (goto-char vc-sentinel-movepoint)) > > instead? Looks OK to me. But it's not relevant to this bug or the proposed patch. From unknown Mon Aug 18 14:22:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 May 2015 17:41: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 To: Dmitry Gutov Cc: 20608@debbugs.gnu.org Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.143205724124866 (code B ref 20608); Tue, 19 May 2015 17:41:02 +0000 Received: (at 20608) by debbugs.gnu.org; 19 May 2015 17:40:41 +0000 Received: from localhost ([127.0.0.1]:50370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YulVP-0006Sy-Dg for submit@debbugs.gnu.org; Tue, 19 May 2015 13:40:40 -0400 Received: from mercure.iro.umontreal.ca ([132.204.24.67]:33840) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YulVN-0006Sr-ML for 20608@debbugs.gnu.org; Tue, 19 May 2015 13:40:38 -0400 Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 5381585FDA; Tue, 19 May 2015 13:40:37 -0400 (EDT) Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 971DD1E5B8D; Tue, 19 May 2015 13:40:03 -0400 (EDT) Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 1DB29B4334; Tue, 19 May 2015 13:40:03 -0400 (EDT) From: Stefan Monnier Message-ID: References: <86d21weqsc.fsf@yandex.ru> Date: Tue, 19 May 2015 13:40:03 -0400 In-Reply-To: <86d21weqsc.fsf@yandex.ru> (Dmitry Gutov's message of "Tue, 19 May 2015 14:43:31 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-Spam-Status: No X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > 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). Stefan > diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el > index a2c1cba..d6b50b7 100644 > --- a/lisp/vc/vc-dispatcher.el > +++ b/lisp/vc/vc-dispatcher.el > @@ -183,35 +183,36 @@ Another is that undo information is not kept." > (defvar vc-sentinel-movepoint) ;Dynamically scoped. > (defun vc--process-sentinel (p code) > - (let ((buf (process-buffer p))) > + (let ((buf (process-buffer p)) > + (status (process-status p))) > ;; Impatient users sometime kill "slow" buffers; check liveness > ;; to avoid "error in process sentinel: Selecting deleted buffer". > (when (buffer-live-p buf) > (with-current-buffer buf > (setq mode-line-process > - (let ((status (process-status p))) > - ;; Leave mode-line uncluttered, normally. > - (unless (eq 'exit status) > - (format " (%s)" status)))) > - (let (vc-sentinel-movepoint > - (m (process-mark p))) > - ;; Normally, we want async code such as sentinels to not move point. > - (save-excursion > - (goto-char m) > - ;; Each sentinel may move point and the next one should be run > - ;; at that new point. We could get the same result by having > - ;; each sentinel read&set process-mark, but since `cmd' needs > - ;; to work both for async and sync processes, this would be > - ;; difficult to achieve. > - (vc-exec-after code) > - (move-marker m (point))) > - ;; But sometimes the sentinels really want to move point. > - (when vc-sentinel-movepoint > - (let ((win (get-buffer-window (current-buffer) 0))) > - (if (not win) > - (goto-char vc-sentinel-movepoint) > - (with-selected-window win > - (goto-char vc-sentinel-movepoint)))))))))) > + ;; Leave mode-line uncluttered, normally. > + (unless (eq 'exit status) > + (format " (%s)" status))) > + (unless (eq 'signal status) > + (let (vc-sentinel-movepoint > + (m (process-mark p))) > + ;; Normally, we want async code such as sentinels to not move point. > + (save-excursion > + (goto-char m) > + ;; Each sentinel may move point and the next one should be run > + ;; at that new point. We could get the same result by having > + ;; each sentinel read&set process-mark, but since `cmd' needs > + ;; to work both for async and sync processes, this would be > + ;; difficult to achieve. > + (vc-exec-after code) > + (move-marker m (point))) > + ;; But sometimes the sentinels really want to move point. > + (when vc-sentinel-movepoint > + (let ((win (get-buffer-window (current-buffer) 0))) > + (if (not win) > + (goto-char vc-sentinel-movepoint) > + (with-selected-window win > + (goto-char vc-sentinel-movepoint))))))))))) > (defun vc-set-mode-line-busy-indicator () > (setq mode-line-process From unknown Mon Aug 18 14:22:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted 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 To: Stefan Monnier Cc: 20608@debbugs.gnu.org Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.143250377528936 (code B ref 20608); Sun, 24 May 2015 21:43:02 +0000 Received: (at 20608) by debbugs.gnu.org; 24 May 2015 21:42:55 +0000 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 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 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) 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) References: <86d21weqsc.fsf@yandex.ru> From: Dmitry Gutov Message-ID: <556245C9.5040606@yandex.ru> Date: Mon, 25 May 2015 00:42:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 From unknown Mon Aug 18 14:22:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 May 2015 02:58: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 To: Dmitry Gutov Cc: 20608@debbugs.gnu.org Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.143252265930329 (code B ref 20608); Mon, 25 May 2015 02:58:02 +0000 Received: (at 20608) by debbugs.gnu.org; 25 May 2015 02:57:39 +0000 Received: from localhost ([127.0.0.1]:55114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ywia6-0007t3-PE for submit@debbugs.gnu.org; Sun, 24 May 2015 22:57:39 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:57438) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ywia0-0007sl-5B for 20608@debbugs.gnu.org; Sun, 24 May 2015 22:57:33 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CYDQA731xV/9N+3mhcgxCEAsEVhH6CTQQCAoE8OxIBAQEBAQEBgQpBBYNdAQEDAVYjBQsLDiYSFBgNJIg3CM8jAQEBAQEFAQEBAR6LOoUFB4QtAQSLRKlAI4I7gVkigngBAQE X-IPAS-Result: A0CYDQA731xV/9N+3mhcgxCEAsEVhH6CTQQCAoE8OxIBAQEBAQEBgQpBBYNdAQEDAVYjBQsLDiYSFBgNJIg3CM8jAQEBAQEFAQEBAR6LOoUFB4QtAQSLRKlAI4I7gVkigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="122061216" Received: from 104-222-126-211.cpe.teksavvy.com (HELO fmsmemgm.homelinux.net) ([104.222.126.211]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 May 2015 22:57:22 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 53684AE058; Sun, 24 May 2015 22:57:22 -0400 (EDT) From: Stefan Monnier Message-ID: References: <86d21weqsc.fsf@yandex.ru> Date: Sun, 24 May 2015 22:57:22 -0400 In-Reply-To: <86d21weqsc.fsf@yandex.ru> (Dmitry Gutov's message of "Tue, 19 May 2015 14:43:31 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > See the window shrink and "Show 2X entries Show unlimited entries" > appear at the top (it will also get added at the bottom when the process > finishes). > 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: Could it be that the problem is that in vc-do-command we first do (unless (or (eq buffer t) (and (stringp buffer) (string= (buffer-name) buffer)) (eq buffer (current-buffer))) (vc-setup-buffer buffer)) and only afterwards do we do (let ((oldproc (get-buffer-process (current-buffer)))) ;; If we wanted to wait for oldproc to finish before doing ;; something, we'd have used vc-eval-after. ;; Use `delete-process' rather than `kill-process' because we don't ;; want any of its output to appear from now on. (when oldproc (delete-process oldproc))) ? -- Stefan From unknown Mon Aug 18 14:22:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 May 2015 23:42: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 To: Stefan Monnier Cc: 20608@debbugs.gnu.org Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.14325972841398 (code B ref 20608); Mon, 25 May 2015 23:42:02 +0000 Received: (at 20608) by debbugs.gnu.org; 25 May 2015 23:41:24 +0000 Received: from localhost ([127.0.0.1]:56011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yx1zn-0000MU-Tq for submit@debbugs.gnu.org; Mon, 25 May 2015 19:41:24 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:35143) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yx1zl-0000MH-GT for 20608@debbugs.gnu.org; Mon, 25 May 2015 19:41:22 -0400 Received: by wicmx19 with SMTP id mx19so59805079wic.0 for <20608@debbugs.gnu.org>; Mon, 25 May 2015 16:41:15 -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=gditPsgjSgXhy5Hr410ipIs65pNDk6wDv1/yIFqwf0U=; b=jY6uQhevzv8aJJ4VpQc3aCDf0hErWZTjI/SCra9LbBVx6FAWm2uadCnFRU3T9PeOMP mzrhgYpfZSNV4F+q55rwZYkSQ5EQo8rD0+zCmb3TooMl84FC1dSdXbg+C712erLCg3hC wg9cdSrbVGIKqdUe6djiIRKdfZ0cL9jiEIHPDvWmR+S7nHzEYPX0Qu4qFDiqR5OzWdmC ubkJn6uMxDnfmlZStwE2EXwMSL5yBFX8YjTnQM056B1q05J6Xa4mMYXbcsNN7Dk4LUME 0xV68iJnm8+Dto7jisNv6TPGsmeyUt8CvJFEJ9FEPPHwgJb4oPqqFcgnB/4cot5IpUh/ U96Q== X-Received: by 10.194.235.4 with SMTP id ui4mr20552949wjc.0.1432597275767; Mon, 25 May 2015 16:41:15 -0700 (PDT) Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id u6sm17274104wja.40.2015.05.25.16.41.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2015 16:41:15 -0700 (PDT) References: <86d21weqsc.fsf@yandex.ru> From: Dmitry Gutov Message-ID: <5563B319.707@yandex.ru> Date: Tue, 26 May 2015 02:41:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 05/25/2015 05:57 AM, Stefan Monnier wrote: > Could it be that the problem is that in vc-do-command we first do > ... > and only afterwards do we do > ... > ? Swapping them makes no difference. It doesn't help with the viability of my latest patch (for vc-log-internal-common) either. From unknown Mon Aug 18 14:22:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 May 2015 20:54:01 +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 To: Dmitry Gutov Cc: 20608@debbugs.gnu.org Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.143267359811340 (code B ref 20608); Tue, 26 May 2015 20:54:01 +0000 Received: (at 20608) by debbugs.gnu.org; 26 May 2015 20:53:18 +0000 Received: from localhost ([127.0.0.1]:57453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YxLqf-0002wq-9N for submit@debbugs.gnu.org; Tue, 26 May 2015 16:53:17 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:50866) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YxLqa-0002wY-Oq for 20608@debbugs.gnu.org; Tue, 26 May 2015 16:53:13 -0400 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t4QKrBJB013076; Tue, 26 May 2015 16:53:11 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 0F25A660ED; Tue, 26 May 2015 16:53:12 -0400 (EDT) From: Stefan Monnier Message-ID: References: <86d21weqsc.fsf@yandex.ru> <5563B319.707@yandex.ru> Date: Tue, 26 May 2015 16:53:12 -0400 In-Reply-To: <5563B319.707@yandex.ru> (Dmitry Gutov's message of "Tue, 26 May 2015 02:41:13 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5318=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5318> : inlines <3074> : streams <1445201> : uri <1940711> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >> Could it be that the problem is that in vc-do-command we first do >> ... >> and only afterwards do we do >> ... >> ? > Swapping them makes no difference. Hmm... so I guess in the case at hand, the issue is that the buffer is setup (e.g. erased) before calling vc-do-command (unless the issue is that the sentinel is not run during delete-process but only later, but my reading of process.c makes me think this should not be the case). But I think the real fix is in this direction: kill the process (and run its sentinel) earlier, i.e. before setting up the buffer. The reason why I think this is the better way forward, is that it lets us run the sentinels in the normal way, so we don't need to worry about what the sentinels might or might not do. Stefan From unknown Mon Aug 18 14:22:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 May 2015 14:15:03 +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 To: Stefan Monnier Cc: 20608@debbugs.gnu.org Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.14327360873814 (code B ref 20608); Wed, 27 May 2015 14:15:03 +0000 Received: (at 20608) by debbugs.gnu.org; 27 May 2015 14:14:47 +0000 Received: from localhost ([127.0.0.1]:58468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yxc6U-0000zM-Vj for submit@debbugs.gnu.org; Wed, 27 May 2015 10:14:47 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:38717) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yxc6P-0000z6-4Y for 20608@debbugs.gnu.org; Wed, 27 May 2015 10:14:42 -0400 Received: by wizo1 with SMTP id o1so24268479wiz.1 for <20608@debbugs.gnu.org>; Wed, 27 May 2015 07:14:31 -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=ROruJlR+K0U5ts3zuAK8BAyrfOSDJXLcQqBKdGC/gy4=; b=OTMMK18MVNu2Tsk4RlaZ43X1zbuT96vAzQv+AKHRg573PXCW/1+ynpUl5CCVAvTrVa WN64Sa8TqbduS+G14LSSrakqtc/WNH6q0Vxdmp1y28778pyZOGPrE9du0597TAcTXOCD 6OEb9+6eB6zHklzbpm+MVZmP1mDqmUoxFRX+MuvEHUZwtKy2LWbW06nMgq6TVcZAyTHP 5uqoHtqUIFu01wM4FPTBNrrdRw+IhvmSTY4sirtMbE+nr1QrYVsLtAkBmKNoNRWl2Prn ch3aoPDLbweCmgWGcMjzLk3ygX47YBAs7Ag/9fBtXZUDIZfQw9Lm3mLuyHuFSbGflCE/ fg9A== X-Received: by 10.180.99.231 with SMTP id et7mr18451086wib.23.1432736071563; Wed, 27 May 2015 07:14:31 -0700 (PDT) Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id l6sm27120994wjz.4.2015.05.27.07.14.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 May 2015 07:14:31 -0700 (PDT) References: <86d21weqsc.fsf@yandex.ru> <5563B319.707@yandex.ru> From: Dmitry Gutov Message-ID: <5565D145.3040606@yandex.ru> Date: Wed, 27 May 2015 17:14:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 05/26/2015 11:53 PM, Stefan Monnier wrote: > Hmm... so I guess in the case at hand, the issue is that the buffer is > setup (e.g. erased) before calling vc-do-command Indeed, vc-git-print-log calls vc-setup-buffer. > But I think the real fix is in this direction: kill the process (and run > its sentinel) earlier, i.e. before setting up the buffer. > > The reason why I think this is the better way forward, is that it lets > us run the sentinels in the normal way, so we don't need to worry about > what the sentinels might or might not do. Good point, then the delayed code being unable to read the process status is irrelevant. Any reservations about this patch? diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index a2c1cba..ec55867 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -171,6 +171,12 @@ Another is that undo information is not kept." (let ((camefrom (current-buffer)) (olddir default-directory)) (set-buffer (get-buffer-create buf)) + (let ((oldproc (get-buffer-process (current-buffer)))) + ;; If we wanted to wait for oldproc to finish before doing + ;; something, we'd have used vc-eval-after. + ;; Use `delete-process' rather than `kill-process' because we don't + ;; want any of its output to appear from now on. + (when oldproc (delete-process oldproc))) (kill-all-local-variables) (set (make-local-variable 'vc-parent-buffer) camefrom) (set (make-local-variable 'vc-parent-buffer-name) @@ -302,12 +308,6 @@ case, and the process object in the asynchronous case." (eq buffer (current-buffer))) (vc-setup-buffer buffer)) ;; If there's some previous async process still running, just kill it. - (let ((oldproc (get-buffer-process (current-buffer)))) - ;; If we wanted to wait for oldproc to finish before doing - ;; something, we'd have used vc-eval-after. - ;; Use `delete-process' rather than `kill-process' because we don't - ;; want any of its output to appear from now on. - (when oldproc (delete-process oldproc))) (let ((squeezed (remq nil flags)) (inhibit-read-only t) (status 0)) From unknown Mon Aug 18 14:22:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 May 2015 16:27: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 To: Dmitry Gutov Cc: 20608@debbugs.gnu.org Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.143274401615886 (code B ref 20608); Wed, 27 May 2015 16:27:02 +0000 Received: (at 20608) by debbugs.gnu.org; 27 May 2015 16:26:56 +0000 Received: from localhost ([127.0.0.1]:58562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YxeAS-000489-4k for submit@debbugs.gnu.org; Wed, 27 May 2015 12:26:56 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:24084) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YxeAP-00047s-SF for 20608@debbugs.gnu.org; Wed, 27 May 2015 12:26:54 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CbDQA731xV/9N+3mhcgxCEAsYTgk0EAgKBPDwRAQEBAQEBAYEKQQWDXQEBAwFWIwULCw4mEhQYDSSINwjPIwEBAQEBAQQBAQEBHos6hQUHhC0Fi0STU4ZpjwQjgWZVgVkigngBAQE X-IPAS-Result: A0CbDQA731xV/9N+3mhcgxCEAsYTgk0EAgKBPDwRAQEBAQEBAYEKQQWDXQEBAwFWIwULCw4mEhQYDSSINwjPIwEBAQEBAQQBAQEBHos6hQUHhC0Fi0STU4ZpjwQjgWZVgVkigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="122407376" Received: from 104-222-126-211.cpe.teksavvy.com (HELO ceviche.home) ([104.222.126.211]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 May 2015 12:26:48 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 09CAD660ED; Wed, 27 May 2015 12:26:48 -0400 (EDT) From: Stefan Monnier Message-ID: References: <86d21weqsc.fsf@yandex.ru> <5563B319.707@yandex.ru> <5565D145.3040606@yandex.ru> Date: Wed, 27 May 2015 12:26:48 -0400 In-Reply-To: <5565D145.3040606@yandex.ru> (Dmitry Gutov's message of "Wed, 27 May 2015 17:14:29 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Any reservations about this patch? Assuming it works, LGTM, Stefan > diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el > index a2c1cba..ec55867 100644 > --- a/lisp/vc/vc-dispatcher.el > +++ b/lisp/vc/vc-dispatcher.el > @@ -171,6 +171,12 @@ Another is that undo information is not kept." > (let ((camefrom (current-buffer)) > (olddir default-directory)) > (set-buffer (get-buffer-create buf)) > + (let ((oldproc (get-buffer-process (current-buffer)))) > + ;; If we wanted to wait for oldproc to finish before doing > + ;; something, we'd have used vc-eval-after. > + ;; Use `delete-process' rather than `kill-process' because we don't > + ;; want any of its output to appear from now on. > + (when oldproc (delete-process oldproc))) > (kill-all-local-variables) > (set (make-local-variable 'vc-parent-buffer) camefrom) > (set (make-local-variable 'vc-parent-buffer-name) > @@ -302,12 +308,6 @@ case, and the process object in the asynchronous case." > (eq buffer (current-buffer))) > (vc-setup-buffer buffer)) > ;; If there's some previous async process still running, just > kill it. > - (let ((oldproc (get-buffer-process (current-buffer)))) > - ;; If we wanted to wait for oldproc to finish before doing > - ;; something, we'd have used vc-eval-after. > - ;; Use `delete-process' rather than `kill-process' because we don't > - ;; want any of its output to appear from now on. > - (when oldproc (delete-process oldproc))) > (let ((squeezed (remq nil flags)) > (inhibit-read-only t) > (status 0)) From unknown Mon Aug 18 14:22:54 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dmitry Gutov Subject: bug#20608: closed (Re: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted) Message-ID: References: <5566534F.4010308@yandex.ru> <86d21weqsc.fsf@yandex.ru> X-Gnu-PR-Message: they-closed 20608 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 20608@debbugs.gnu.org Date: Wed, 27 May 2015 23:30:07 +0000 Content-Type: multipart/mixed; boundary="----------=_1432769407-27740-1" This is a multi-part message in MIME format... ------------=_1432769407-27740-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when= interrupted which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 20608@debbugs.gnu.org. --=20 20608: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D20608 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1432769407-27740-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 20608-done) by debbugs.gnu.org; 27 May 2015 23:29:29 +0000 Received: from localhost ([127.0.0.1]:58732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YxklN-0007CP-4t for submit@debbugs.gnu.org; Wed, 27 May 2015 19:29:29 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:37978) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YxklL-0007C9-0C for 20608-done@debbugs.gnu.org; Wed, 27 May 2015 19:29:28 -0400 Received: by wizo1 with SMTP id o1so41005722wiz.1 for <20608-done@debbugs.gnu.org>; Wed, 27 May 2015 16:29:21 -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=Tf+lHL9zcS2y6itT4ThKJ+6wCN9Y5c4gs5KMHekmRqc=; b=HwYEJ/G2wxNSjT3JYZZ9OrSXGAR7TFjkaQ9O3lwj4XJtYPAloml67U7MF5I4ODMo0B Fwm4BR7FzOGrrlTSv9p0KSad1P22MvBcTlYGvB2Co/4tLLqfyfY1bkajDX4qtWFDgM42 GjMm/T2rCziZzVh1uOghtwtDiQ6YjAVZq6/5gA+PeO1gfEjcFqVwJWfO5tSNHwa5/PMk Z1DYUjGppl9VIW0XLiQVxFUbGGG2Muoj0HxzcGYZvux/QUojNrmUYmX/+sIBQ6MN73eN /uD4HXRNZjTGEoRmoWCn5IEGtrJp5EcxySmHtRZWk4zjMJ3oPKg+3sG+LbfEJ/tiZpm2 MM1A== X-Received: by 10.180.88.8 with SMTP id bc8mr10205836wib.19.1432769361432; Wed, 27 May 2015 16:29:21 -0700 (PDT) Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id lz17sm433540wic.24.2015.05.27.16.29.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 May 2015 16:29:21 -0700 (PDT) Subject: Re: bug#20608: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted To: Stefan Monnier References: <86d21weqsc.fsf@yandex.ru> <5563B319.707@yandex.ru> <5565D145.3040606@yandex.ru> From: Dmitry Gutov Message-ID: <5566534F.4010308@yandex.ru> Date: Thu, 28 May 2015 02:29:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20608-done Cc: 20608-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 05/27/2015 07:26 PM, Stefan Monnier wrote: > Assuming it works, LGTM, It does solve the described problem. Thanks for taking a look, installed. ------------=_1432769407-27740-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 19 May 2015 11:44:05 +0000 Received: from localhost ([127.0.0.1]:49648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YufwK-0006IQ-Ey for submit@debbugs.gnu.org; Tue, 19 May 2015 07:44:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48546) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YufwI-0006Hn-4m for submit@debbugs.gnu.org; Tue, 19 May 2015 07:44:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YufwB-0007p4-QG for submit@debbugs.gnu.org; Tue, 19 May 2015 07:43:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YufwB-0007p0-N7 for submit@debbugs.gnu.org; Tue, 19 May 2015 07:43:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YufwA-0004ly-CQ for bug-gnu-emacs@gnu.org; Tue, 19 May 2015 07:43:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yufw5-0007oD-DH for bug-gnu-emacs@gnu.org; Tue, 19 May 2015 07:43:54 -0400 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:33426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yufw5-0007mH-6m for bug-gnu-emacs@gnu.org; Tue, 19 May 2015 07:43:49 -0400 Received: by wgjc11 with SMTP id c11so14523556wgj.0 for ; Tue, 19 May 2015 04:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=gjvu95S80bTuAMQj3Vo8r+/YNSKaI5yKvQr7vpQsqLI=; b=dKX1rzjKEWcGpVDTbxEjudnJ0MO9lenh2drdBtE+Vlw8DVJYKyRiFJhWDI5QWVw5gk Hfaog4r5ea+CG/HREpZzTqplOFt+CejYt2beWvCWfZE2QtRSN5MKZF/A3yclnGqyavX2 EAaNXe9cTuTJGS6bbNf7Qx456MpolYaoOVRlMqj2XsriDWJw2aGRTprqK0imAk9ySWU0 4Acb3qWAdyahxeuQIxh9ZS5ahTnxggQwVbNfzzYAg03Zfq8Ea3L2HaBYRl+pooAVaiqB Ni4E1lLx1QiklZD+3niqWpGEtGEYu0B2GFJ1DN8X2yn+z2WQttYCLRiIYdMJhTEEzmaL NhPw== X-Received: by 10.180.88.72 with SMTP id be8mr31138007wib.45.1432035818155; Tue, 19 May 2015 04:43:38 -0700 (PDT) Received: from axl ([82.102.93.54]) by mx.google.com with ESMTPSA id kc4sm21426498wjc.2.2015.05.19.04.43.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2015 04:43:34 -0700 (PDT) From: Dmitry Gutov To: bug-gnu-emacs@gnu.org Subject: 25.0.50; vc-git-log-view-mode inserts "Show 2X entries" at bob when interrupted Date: Tue, 19 May 2015 14:43:31 +0300 Message-ID: <86d21weqsc.fsf@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Tags: patch 1. Visit lisp/vc/vc-dispatcher.el (the important part being that it's a file with long history). 2. Press C-x v l, see the print-log buffer pop up, with [waiting ...]. 3. Press g before the process finishes running. See the window shrink and "Show 2X entries Show unlimited entries" appear at the top (it will also get added at the bottom when the process finishes). 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: diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index a2c1cba..d6b50b7 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -183,35 +183,36 @@ Another is that undo information is not kept." (defvar vc-sentinel-movepoint) ;Dynamically scoped. (defun vc--process-sentinel (p code) - (let ((buf (process-buffer p))) + (let ((buf (process-buffer p)) + (status (process-status p))) ;; Impatient users sometime kill "slow" buffers; check liveness ;; to avoid "error in process sentinel: Selecting deleted buffer". (when (buffer-live-p buf) (with-current-buffer buf (setq mode-line-process - (let ((status (process-status p))) - ;; Leave mode-line uncluttered, normally. - (unless (eq 'exit status) - (format " (%s)" status)))) - (let (vc-sentinel-movepoint - (m (process-mark p))) - ;; Normally, we want async code such as sentinels to not move point. - (save-excursion - (goto-char m) - ;; Each sentinel may move point and the next one should be run - ;; at that new point. We could get the same result by having - ;; each sentinel read&set process-mark, but since `cmd' needs - ;; to work both for async and sync processes, this would be - ;; difficult to achieve. - (vc-exec-after code) - (move-marker m (point))) - ;; But sometimes the sentinels really want to move point. - (when vc-sentinel-movepoint - (let ((win (get-buffer-window (current-buffer) 0))) - (if (not win) - (goto-char vc-sentinel-movepoint) - (with-selected-window win - (goto-char vc-sentinel-movepoint)))))))))) + ;; Leave mode-line uncluttered, normally. + (unless (eq 'exit status) + (format " (%s)" status))) + (unless (eq 'signal status) + (let (vc-sentinel-movepoint + (m (process-mark p))) + ;; Normally, we want async code such as sentinels to not move point. + (save-excursion + (goto-char m) + ;; Each sentinel may move point and the next one should be run + ;; at that new point. We could get the same result by having + ;; each sentinel read&set process-mark, but since `cmd' needs + ;; to work both for async and sync processes, this would be + ;; difficult to achieve. + (vc-exec-after code) + (move-marker m (point))) + ;; But sometimes the sentinels really want to move point. + (when vc-sentinel-movepoint + (let ((win (get-buffer-window (current-buffer) 0))) + (if (not win) + (goto-char vc-sentinel-movepoint) + (with-selected-window win + (goto-char vc-sentinel-movepoint))))))))))) (defun vc-set-mode-line-busy-indicator () (setq mode-line-process ------------=_1432769407-27740-1--