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: Tue, 19 May 2015 14:43:31 +0300 Message-ID: <86d21weqsc.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1432035930 22287 80.91.229.3 (19 May 2015 11:45:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 May 2015 11:45:30 +0000 (UTC) To: 20608@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 19 13:45:20 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 1YufxX-0007QT-UL for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 May 2015 13:45:20 +0200 Original-Received: from localhost ([::1]:45137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YufxS-0004sY-2k for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 May 2015 07:45:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YufxN-0004sG-7b for bug-gnu-emacs@gnu.org; Tue, 19 May 2015 07:45:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YufxI-00081I-7p for bug-gnu-emacs@gnu.org; Tue, 19 May 2015 07:45:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YufxI-00080t-1j for bug-gnu-emacs@gnu.org; Tue, 19 May 2015 07:45:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YufxH-0006K1-Of for bug-gnu-emacs@gnu.org; Tue, 19 May 2015 07:45:03 -0400 X-Loop: help-debbugs@gnu.org 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 X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.143203584524210 (code B ref -1); Tue, 19 May 2015 11:45:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 May 2015 11:44:05 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) Original-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) 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-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:102945 Archived-At: 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