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: Wed, 27 May 2015 17:14:29 +0300 Message-ID: <5565D145.3040606@yandex.ru> References: <86d21weqsc.fsf@yandex.ru> <5563B319.707@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 1432736129 11259 80.91.229.3 (27 May 2015 14:15:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 May 2015 14:15:29 +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 Wed May 27 16:15:19 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 1Yxc74-00010d-8t for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 May 2015 16:15:18 +0200 Original-Received: from localhost ([::1]:54151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxc73-0002Kh-IH for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 May 2015 10:15:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxc6w-0002KR-LT for bug-gnu-emacs@gnu.org; Wed, 27 May 2015 10:15:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxc6q-0005NZ-Oh for bug-gnu-emacs@gnu.org; Wed, 27 May 2015 10:15:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxc6q-0005NH-LT for bug-gnu-emacs@gnu.org; Wed, 27 May 2015 10:15:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Yxc6q-00010G-6h for bug-gnu-emacs@gnu.org; Wed, 27 May 2015 10:15:04 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 20608-submit@debbugs.gnu.org id=B20608.14327360873814 (code B ref 20608); Wed, 27 May 2015 14:15:03 +0000 Original-Received: (at 20608) by debbugs.gnu.org; 27 May 2015 14:14:47 +0000 Original-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 Original-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 Original-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) Original-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) 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:103211 Archived-At: 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))