all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rcopley@gmail.com, 15322@debbugs.gnu.org
Subject: bug#15322: VC log buffer scrolls itself
Date: Sun, 3 May 2015 18:58:35 +0300	[thread overview]
Message-ID: <554645AB.5080308@yandex.ru> (raw)
In-Reply-To: <83h9rtu3vk.fsf@gnu.org>

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)






  reply	other threads:[~2015-05-03 15:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 13:24 bug#15322: VC log buffer scrolls itself Paul Pogonyshev
2013-09-10 15:57 ` Eli Zaretskii
2013-09-10 16:04 ` Glenn Morris
2013-09-10 18:05   ` Glenn Morris
2013-09-10 18:30     ` Eli Zaretskii
2013-09-11  6:58       ` Paul Pogonyshev
2013-09-11 13:28         ` Eli Zaretskii
2013-09-12  6:26     ` Glenn Morris
2013-09-12  7:25       ` Paul Pogonyshev
2013-09-12 15:57         ` Glenn Morris
2013-09-12 19:09           ` Stefan Monnier
2013-09-12 19:30             ` Glenn Morris
2013-09-26  7:17               ` Paul Pogonyshev
2013-10-24  8:39                 ` Paul Pogonyshev
2013-10-24  8:49                   ` Andreas Schwab
2013-10-24 14:24                     ` Stefan Monnier
2014-08-02 16:04                       ` Paul Pogonyshev
2015-05-03  3:38                     ` Dmitry Gutov
2014-11-19 21:19 ` Richard Copley
2014-11-19 21:57   ` Richard Copley
2015-05-03  3:32     ` Dmitry Gutov
2015-05-03 14:34       ` Eli Zaretskii
2015-05-03 15:58         ` Dmitry Gutov [this message]
2015-05-03 16:32           ` Eli Zaretskii
2015-05-03 18:33             ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=554645AB.5080308@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=15322@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rcopley@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.