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, 03 May 2015 06:32:37 +0300 Message-ID: <861tiy5oa2.fsf@yandex.ru> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430624005 1556 80.91.229.3 (3 May 2015 03:33:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 May 2015 03:33:25 +0000 (UTC) Cc: 15322@debbugs.gnu.org To: Richard Copley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 03 05:33:11 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 1YokeU-0001FM-1t for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 May 2015 05:33:10 +0200 Original-Received: from localhost ([::1]:58323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YokeT-0000r5-HZ for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 May 2015 23:33:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YokeQ-0000qo-09 for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 23:33:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YokeM-0001En-P1 for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 23:33:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YokeM-0001Dw-Lf for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 23:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YokeM-0008NS-7P for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 23:33: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 03:33: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.143062396932181 (code B ref 15322); Sun, 03 May 2015 03:33:02 +0000 Original-Received: (at 15322) by debbugs.gnu.org; 3 May 2015 03:32:49 +0000 Original-Received: from localhost ([127.0.0.1]:60096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yoke9-0008Mz-32 for submit@debbugs.gnu.org; Sat, 02 May 2015 23:32:49 -0400 Original-Received: from mail-wi0-f170.google.com ([209.85.212.170]:34241) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yoke6-0008Mj-9q for 15322@debbugs.gnu.org; Sat, 02 May 2015 23:32:47 -0400 Original-Received: by wicmx19 with SMTP id mx19so54690735wic.1 for <15322@debbugs.gnu.org>; Sat, 02 May 2015 20:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=9V1zkcmi1Qm358cQ6aQezEMJmA6rptTWkjW0bQE81m8=; b=y63JxX8diEucUXHTO6ugRrGYio8zJ12HVAgGyiwKnJdAWbnT1t/BZY1OHGD4h6thyI FZ2QBOVD9l7vO4apsaVWCGvsJPZE8cdHtLj5XYqNHzFPMTZoh8vhlwCBtz9GH44VBxNz o8hRYGgY6AFtX5gji9KWRnW5QvEccg05pAGmic99rnxIWrWwQKX4MlUoGvQ5yDKdkPTF nRlKntfomE4uLkqtxailFYbE/l5W/wrsvQckJwA0QAwfwTAkYxCmYipZRLWnRhkAokoA O3q/tNTQ/mVxQcqy5LWIbvQxiwiWPgGBQkjivq80cHQSTn4d6618MLGZErjRO9Km6xc5 gasg== X-Received: by 10.180.104.225 with SMTP id gh1mr8671988wib.65.1430623960569; Sat, 02 May 2015 20:32:40 -0700 (PDT) Original-Received: from axl ([82.102.93.54]) by mx.google.com with ESMTPSA id a18sm14236822wja.46.2015.05.02.20.32.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 May 2015 20:32:40 -0700 (PDT) In-Reply-To: (Richard Copley's message of "Wed, 19 Nov 2014 21:57:47 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) 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:102389 Archived-At: Richard Copley writes: > ... perhaps I was going too far, but a fix is still needed to stop > point jumping to the beginning of the buffer when working-revision is > null (at least in Subversion). I suggest not calling > `goto-location-func' or setting vc-sentinel-movepoint when > working-revision is null, in `vc-print-log-internal'. > > I also suggest a null working-revision be passed by > `vc-print-root-log', by the same argument Stefan used for > `vc-print-log'. Makes sense to me. Unless someone objects, I'm going to install the following patch: diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index bb4dd60..f64f42e 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2224,8 +2224,9 @@ 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 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 +2264,10 @@ 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)) + ;; Bug#15322 + (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 (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)