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#15322: VC log buffer scrolls itself Date: Sun, 3 May 2015 18:58:35 +0300 Message-ID: <554645AB.5080308@yandex.ru> References: <861tiy5oa2.fsf@yandex.ru> <83h9rtu3vk.fsf@gnu.org> 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 1430668762 4303 80.91.229.3 (3 May 2015 15:59:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 May 2015 15:59:22 +0000 (UTC) Cc: rcopley@gmail.com, 15322@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 03 17:59:12 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 1YowIQ-0003wy-JY for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 May 2015 17:59:10 +0200 Original-Received: from localhost ([::1]:59568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YowIP-0004wg-VG for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 May 2015 11:59:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YowIM-0004wa-Ou for bug-gnu-emacs@gnu.org; Sun, 03 May 2015 11:59:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YowII-0000Qi-NL for bug-gnu-emacs@gnu.org; Sun, 03 May 2015 11:59:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YowII-0000Qe-JW for bug-gnu-emacs@gnu.org; Sun, 03 May 2015 11:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YowII-00059M-3P for bug-gnu-emacs@gnu.org; Sun, 03 May 2015 11:59: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, 03 May 2015 15:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15322 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15322-submit@debbugs.gnu.org id=B15322.143066872919778 (code B ref 15322); Sun, 03 May 2015 15:59:02 +0000 Original-Received: (at 15322) by debbugs.gnu.org; 3 May 2015 15:58:49 +0000 Original-Received: from localhost ([127.0.0.1]:60845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YowI4-00058v-Vm for submit@debbugs.gnu.org; Sun, 03 May 2015 11:58:49 -0400 Original-Received: from mail-wi0-f181.google.com ([209.85.212.181]:33664) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YowI2-00058i-Kj for 15322@debbugs.gnu.org; Sun, 03 May 2015 11:58:47 -0400 Original-Received: by wief7 with SMTP id f7so61664145wie.0 for <15322@debbugs.gnu.org>; Sun, 03 May 2015 08:58:40 -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=bUExVoB9spfcCGw8xNSBHI77F//mlmoGvGSttnR7EtA=; b=SkCcK9FM0m3Ye4Kz8trqH6nj9E7tUBPCeD/096WbZ5mTxFeKI7doAmBVmmNkOFYVqB ueeaxgGt0dO/ena/tAVIYpuMA0xOy4/UdXQerXwign807IE81UFbXwCVVzKloopNOhwz tbVjOscFPceq01Xs89QH2Gkfa4g5Qkahr3l0Zgkt60YBYHM8mLxWxZnXce7Kjs0R96gJ y99LQNXkeLTgk1bspfQEcduaof0WoHhu8b9vfc45rn6zxEGy1xBUoquhFmsKVvBH0bLt by6rTFHVZCBIzbc1t78+/7YAPRoSAPv9U3TXCtsSnwmJI1FVFzaTqkhUOX9V0cAXJdDl sNHQ== X-Received: by 10.180.85.42 with SMTP id e10mr12424232wiz.17.1430668720748; Sun, 03 May 2015 08:58:40 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id s4sm7149581wix.14.2015.05.03.08.58.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 May 2015 08:58:40 -0700 (PDT) user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 in-reply-to: <83h9rtu3vk.fsf@gnu.org> 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:102403 Archived-At: On 05/03/2015 05:34 PM, Eli Zaretskii wrote: > I don't think it's a good idea to have in the code comments that only > mention the bug number, without also trying to explain the reason(s) > for what the code does. Okay. That exact piece of code should be self-evident, but I've added some words else where, as well as the bug reference anyway. > If it's possible to write a clear and concise> explanation, you don't even need to mention the bug number. The surrounding code is pretty hairy, so might be possible to regress by accident. This way, someone changing it would look at the bug first. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index bb4dd60..1a997a4 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2224,8 +2224,10 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)." (lambda (_bk _files-arg ret) (vc-print-log-setup-buttons working-revision is-start-revision limit ret)) - (lambda (bk) - (vc-call-backend bk 'show-log-entry working-revision)) + ;; When it's nil, point really shouldn't move (bug#15322). + (when working-revision + (lambda (bk) + (vc-call-backend bk 'show-log-entry working-revision))) (lambda (_ignore-auto _noconfirm) (vc-print-log-internal backend files working-revision is-start-revision limit))))) @@ -2263,8 +2265,9 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)." (let ((inhibit-read-only t)) (funcall setup-buttons-func backend files retval) (shrink-window-if-larger-than-buffer) - (funcall goto-location-func backend) - (setq vc-sentinel-movepoint (point)) + (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) @@ -2273,7 +2276,7 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)." (lambda (bk buf type-arg _files) (vc-call-backend bk type-arg buf remote-location)) (lambda (_bk _files-arg _ret) nil) - (lambda (_bk) (goto-char (point-min))) + nil ;; Don't move point. (lambda (_ignore-auto _noconfirm) (vc-incoming-outgoing-internal backend remote-location buffer-name type)))) @@ -2328,16 +2331,15 @@ When called interactively with a prefix argument, prompt for LIMIT." (list (when (> vc-log-show-limit 0) vc-log-show-limit))))) (let ((backend (vc-deduce-backend)) (default-directory default-directory) - rootdir working-revision) + rootdir) (if backend (setq rootdir (vc-call-backend backend 'root default-directory)) (setq rootdir (read-directory-name "Directory for VC root-log: ")) (setq backend (vc-responsible-backend rootdir)) (unless backend (error "Directory is not version controlled"))) - (setq working-revision (vc-working-revision rootdir) - default-directory rootdir) - (vc-print-log-internal backend (list rootdir) working-revision nil limit))) + (setq default-directory rootdir) + (vc-print-log-internal backend (list rootdir) nil nil limit))) ;;;###autoload (defun vc-log-incoming (&optional remote-location)