GNU bug report logs - #15322
VC log buffer scrolls itself

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>

Date: Tue, 10 Sep 2013 15:45:05 UTC

Severity: wishlist

Merged with 6351

Found in version 23.1.95

Fixed in version 25.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15322 in the body.
You can then email your comments to 15322 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Tue, 10 Sep 2013 15:45:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Pogonyshev <pogonyshev <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 10 Sep 2013 15:45:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: VC log buffer scrolls itself
Date: Tue, 10 Sep 2013 15:24:52 +0200
[Message part 1 (text/plain, inline)]
To reproduce (this assumes a large project for which log is generated for
5+ seconds):

- 'C-x v d' a project directory;
- hit 'l' to view log of changes;
- visible (top) part of the buffer is filled with the most recent entries,
which you are most likely interested in;
- wait till log buffer is filled;
- observe the log buffer point jump to some arbitrary (or at least I have
no idea what it is) revision's entry.

This behavior is certainly not wanted for me. Even assuming the entry it
jumps to has some special meaning and not chosen randomly, 99% of time I'm
interested in the recent changes, not a change 2 years ago.

Paul
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Tue, 10 Sep 2013 15:58:01 GMT) Full text and rfc822 format available.

Message #8 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Tue, 10 Sep 2013 18:57:40 +0300
> Date: Tue, 10 Sep 2013 15:24:52 +0200
> From: Paul Pogonyshev <pogonyshev <at> gmail.com>
> 
> To reproduce (this assumes a large project for which log is generated for
> 5+ seconds):
> 
> - 'C-x v d' a project directory;
> - hit 'l' to view log of changes;
> - visible (top) part of the buffer is filled with the most recent entries,
> which you are most likely interested in;
> - wait till log buffer is filled;
> - observe the log buffer point jump to some arbitrary (or at least I have
> no idea what it is) revision's entry.

With what back-ends, and which Emacs version?

FWIW, with either the current trunk or v24.3 I don't see this when the
VCS is bzr or git.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Tue, 10 Sep 2013 16:05:01 GMT) Full text and rfc822 format available.

Message #11 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Tue, 10 Sep 2013 12:04:37 -0400
Paul Pogonyshev wrote:

> To reproduce (this assumes a large project for which log is generated for
> 5+ seconds):
>
> - 'C-x v d' a project directory;
> - hit 'l' to view log of changes;
> - visible (top) part of the buffer is filled with the most recent entries,
> which you are most likely interested in;
> - wait till log buffer is filled;
> - observe the log buffer point jump to some arbitrary (or at least I have
> no idea what it is) revision's entry.

No, I don't observe that. So please say: what version of Emacs this is,
what VCS this is, what file is under point when you hit l, what Emacs
thinks the working revision of that file is.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Tue, 10 Sep 2013 18:06:01 GMT) Full text and rfc822 format available.

Message #14 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Tue, 10 Sep 2013 14:05:39 -0400
I'm going to guess that this happens with svn, and that the revision you
end up on is the working revision of whatever file happens to be listed
last in the output of: svn status -v /path/to/svn/directory

Looks like a bug in vc-svn-parse-status when called with filename ==
directory, caused by the "don't trust the output's filename unless we
have to" part.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Tue, 10 Sep 2013 18:31:00 GMT) Full text and rfc822 format available.

Message #17 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: pogonyshev <at> gmail.com, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Tue, 10 Sep 2013 21:30:09 +0300
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Tue, 10 Sep 2013 14:05:39 -0400
> Cc: 15322 <at> debbugs.gnu.org
> 
> I'm going to guess that this happens with svn, and that the revision you
> end up on is the working revision of whatever file happens to be listed
> last in the output of: svn status -v /path/to/svn/directory

Yep, with svn that's what I see, too.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Wed, 11 Sep 2013 06:59:01 GMT) Full text and rfc822 format available.

Message #20 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Glenn Morris <rgm <at> gnu.org>, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Wed, 11 Sep 2013 08:58:19 +0200
[Message part 1 (text/plain, inline)]
Emacs 24.3.1 (built on 2013-08-07), and yes this happens with svn. However,
even if I open log buffer right from the top of 'C-x v d' buffer (i.e.
nothing is be selected or even "under the point"), the buffer still jumps
to some revision from Dec 2011.

Paul


On 10 September 2013 20:30, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Glenn Morris <rgm <at> gnu.org>
> > Date: Tue, 10 Sep 2013 14:05:39 -0400
> > Cc: 15322 <at> debbugs.gnu.org
> >
> > I'm going to guess that this happens with svn, and that the revision you
> > end up on is the working revision of whatever file happens to be listed
> > last in the output of: svn status -v /path/to/svn/directory
>
> Yep, with svn that's what I see, too.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Wed, 11 Sep 2013 13:29:06 GMT) Full text and rfc822 format available.

Message #23 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: rgm <at> gnu.org, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Wed, 11 Sep 2013 16:28:03 +0300
> Date: Wed, 11 Sep 2013 08:58:19 +0200
> From: Paul Pogonyshev <pogonyshev <at> gmail.com>
> Cc: Glenn Morris <rgm <at> gnu.org>, 15322 <at> debbugs.gnu.org
> 
> Emacs 24.3.1 (built on 2013-08-07), and yes this happens with svn. However,
> even if I open log buffer right from the top of 'C-x v d' buffer (i.e.
> nothing is be selected or even "under the point"), the buffer still jumps
> to some revision from Dec 2011.

What happens to be under point is not relevant.  What is relevant is
the last revision you actually have in the sandbox.

Anyway, it's a bug, so what exactly does it do (wrongly) is not
interesting.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Thu, 12 Sep 2013 06:27:01 GMT) Full text and rfc822 format available.

Message #26 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Thu, 12 Sep 2013 02:26:36 -0400
I believe I've fixed it so that it goes to the correct revision
according to the logic of vc. In terms of svn status -v output,

              4271     4264 rgm      .

this would be revision 4264.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Thu, 12 Sep 2013 07:26:02 GMT) Full text and rfc822 format available.

Message #29 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Thu, 12 Sep 2013 09:25:14 +0200
[Message part 1 (text/plain, inline)]
Frankly, I'd prefer it to not go anywhere and just leave the buffer alone,
i.e. never scroll it. At least for subversion, which is known for having
"mixed revision" in working directory all the time. Also, this is much like
stealing focus in UI, only in this case it doesn't steal focus but buffer
point position.

Paul


On 12 September 2013 08:26, Glenn Morris <rgm <at> gnu.org> wrote:

>
> I believe I've fixed it so that it goes to the correct revision
> according to the logic of vc. In terms of svn status -v output,
>
>               4271     4264 rgm      .
>
> this would be revision 4264.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Thu, 12 Sep 2013 15:58:02 GMT) Full text and rfc822 format available.

Message #32 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Thu, 12 Sep 2013 11:57:25 -0400
Paul Pogonyshev wrote:

> Frankly, I'd prefer it to not go anywhere and just leave the buffer alone,
> i.e. never scroll it.

I had a feeling you might say that...

> At least for subversion, which is known for having "mixed revision" in
> working directory all the time. Also, this is much like stealing focus
> in UI, only in this case it doesn't steal focus but buffer point
> position.




Severity set to 'wishlist' from 'normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 12 Sep 2013 17:12:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Thu, 12 Sep 2013 19:10:02 GMT) Full text and rfc822 format available.

Message #37 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Paul Pogonyshev <pogonyshev <at> gmail.com>, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Thu, 12 Sep 2013 15:09:01 -0400
>> Frankly, I'd prefer it to not go anywhere and just leave the buffer alone,
>> i.e. never scroll it.
> I had a feeling you might say that...

And I think that makes sense.  It's natural to select a particular
revision when running vc-print-log from (say) vc-annotate, but for
a plain `C-x v l', the user just wants to see "the log" and presumably
doesn't care about which revision happens to be current.

IOW, I think we're trying too hard here.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Thu, 12 Sep 2013 19:31:01 GMT) Full text and rfc822 format available.

Message #40 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Paul Pogonyshev <pogonyshev <at> gmail.com>, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Thu, 12 Sep 2013 15:30:04 -0400
Stefan Monnier wrote:

> And I think that makes sense.  It's natural to select a particular
> revision when running vc-print-log from (say) vc-annotate, but for
> a plain `C-x v l', the user just wants to see "the log" and presumably
> doesn't care about which revision happens to be current.
>
> IOW, I think we're trying too hard here.

*** lisp/vc/vc.el	2013-09-12 06:10:12 +0000
--- lisp/vc/vc.el	2013-09-12 19:28:04 +0000
***************
*** 2299,2305 ****
    (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef
  	 (backend (car vc-fileset))
  	 (files (cadr vc-fileset))
! 	 (working-revision (or working-revision (vc-working-revision (car files)))))
      (vc-print-log-internal backend files working-revision nil limit)))
  
  ;;;###autoload
--- 2299,2306 ----
    (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef
  	 (backend (car vc-fileset))
  	 (files (cadr vc-fileset))
! ;;	 (working-revision (or working-revision (vc-working-revision (car files))))
!          )
      (vc-print-log-internal backend files working-revision nil limit)))
  
  ;;;###autoload




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Thu, 26 Sep 2013 07:18:03 GMT) Full text and rfc822 format available.

Message #43 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Thu, 26 Sep 2013 09:17:52 +0200
[Message part 1 (text/plain, inline)]
In Emacs built from trunk yesterday it still jumps, though to the "correct"
version (the one reported by 'svn info'). However, given that committing
changes from the buffer does not advance the working directory revision
(e.g. what I have now is 26 revisions in the past), I'm not sure how useful
this is, at least for subversion. Probably it's better for saner VCS's, but
for subversion if feels like annoyance.

Paul


On 12 September 2013 21:30, Glenn Morris <rgm <at> gnu.org> wrote:

> Stefan Monnier wrote:
>
> > And I think that makes sense.  It's natural to select a particular
> > revision when running vc-print-log from (say) vc-annotate, but for
> > a plain `C-x v l', the user just wants to see "the log" and presumably
> > doesn't care about which revision happens to be current.
> >
> > IOW, I think we're trying too hard here.
>
> *** lisp/vc/vc.el       2013-09-12 06:10:12 +0000
> --- lisp/vc/vc.el       2013-09-12 19:28:04 +0000
> ***************
> *** 2299,2305 ****
>     (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef
>          (backend (car vc-fileset))
>          (files (cadr vc-fileset))
> !        (working-revision (or working-revision (vc-working-revision (car
> files)))))
>       (vc-print-log-internal backend files working-revision nil limit)))
>
>   ;;;###autoload
> --- 2299,2306 ----
>     (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef
>          (backend (car vc-fileset))
>          (files (cadr vc-fileset))
> ! ;;     (working-revision (or working-revision (vc-working-revision (car
> files))))
> !          )
>       (vc-print-log-internal backend files working-revision nil limit)))
>
>   ;;;###autoload
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Thu, 24 Oct 2013 08:40:02 GMT) Full text and rfc822 format available.

Message #46 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Thu, 24 Oct 2013 10:39:20 +0200
[Message part 1 (text/plain, inline)]
Let me explain why I think scrolling is *bad*, even if it scrolls to
correct revision. Log buffer here is generated for 5-10 seconds. In the
meantime, I can start reading it, scrolling manually or C-s contents. And
then (when loading is finished) it scrolls to a different position by
itself. This is no better than focus stealing, because it disrupts my
activities.

I tried adding the following advice, nulling 'working-revision':

    (defadvice vc-print-log-internal (before
disable-scrolling-to-working-revision activate)
      (ad-set-arg 2 nil))

but it helped only so much, because now it always scrolls to the buffer
beginning (for SVN it's still an improvement), even if I already C-s to
some older revision.

Is it possible to disable scrolling completely, even if in a hackish way
through my '.emacs'?

Paul


On 26 September 2013 09:17, Paul Pogonyshev <pogonyshev <at> gmail.com> wrote:

> In Emacs built from trunk yesterday it still jumps, though to the
> "correct" version (the one reported by 'svn info'). However, given that
> committing changes from the buffer does not advance the working directory
> revision (e.g. what I have now is 26 revisions in the past), I'm not sure
> how useful this is, at least for subversion. Probably it's better for saner
> VCS's, but for subversion if feels like annoyance.
>
> Paul
>
>
> On 12 September 2013 21:30, Glenn Morris <rgm <at> gnu.org> wrote:
>
>> Stefan Monnier wrote:
>>
>> > And I think that makes sense.  It's natural to select a particular
>> > revision when running vc-print-log from (say) vc-annotate, but for
>> > a plain `C-x v l', the user just wants to see "the log" and presumably
>> > doesn't care about which revision happens to be current.
>> >
>> > IOW, I think we're trying too hard here.
>>
>> *** lisp/vc/vc.el       2013-09-12 06:10:12 +0000
>> --- lisp/vc/vc.el       2013-09-12 19:28:04 +0000
>> ***************
>> *** 2299,2305 ****
>>     (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef
>>          (backend (car vc-fileset))
>>          (files (cadr vc-fileset))
>> !        (working-revision (or working-revision (vc-working-revision (car
>> files)))))
>>       (vc-print-log-internal backend files working-revision nil limit)))
>>
>>   ;;;###autoload
>> --- 2299,2306 ----
>>     (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef
>>          (backend (car vc-fileset))
>>          (files (cadr vc-fileset))
>> ! ;;     (working-revision (or working-revision (vc-working-revision (car
>> files))))
>> !          )
>>       (vc-print-log-internal backend files working-revision nil limit)))
>>
>>   ;;;###autoload
>>
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Thu, 24 Oct 2013 08:50:01 GMT) Full text and rfc822 format available.

Message #49 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Thu, 24 Oct 2013 10:49:26 +0200
IMHO scrolling should only happen if point is still at BOB.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Thu, 24 Oct 2013 14:25:01 GMT) Full text and rfc822 format available.

Message #52 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Paul Pogonyshev <pogonyshev <at> gmail.com>, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Thu, 24 Oct 2013 10:24:28 -0400
> IMHO scrolling should only happen if point is still at BOB.

FWIW, I agree with Paul that scrolling is just a bad idea here.
It's good to do it when we specifically requested to see the log comment
of a particular revision (e.g. we already have a log displayed and from
vc-annotate we ask for the comment of some revision), but otherwise it's
just a waste of effort that ends up annoying more often than not.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Sat, 02 Aug 2014 16:05:02 GMT) Full text and rfc822 format available.

Message #55 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Andreas Schwab <schwab <at> suse.de>, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Sat, 2 Aug 2014 18:04:45 +0200
[Message part 1 (text/plain, inline)]
Bumping this bug.

It is very annoying, because our repository grew quite large, so almost all
logs take at least 5-10 seconds to be generated fully and Emacs snatches
point from me when the log generation is complete. Even if it scrolls back
to the top it is still disruptive as I may be reading second page of
history already.

Paul


On 24 October 2013 16:24, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

> > IMHO scrolling should only happen if point is still at BOB.
>
> FWIW, I agree with Paul that scrolling is just a bad idea here.
> It's good to do it when we specifically requested to see the log comment
> of a particular revision (e.g. we already have a log displayed and from
> vc-annotate we ask for the comment of some revision), but otherwise it's
> just a waste of effort that ends up annoying more often than not.
>
>
>         Stefan
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Wed, 19 Nov 2014 21:20:02 GMT) Full text and rfc822 format available.

Message #58 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Richard Copley <rcopley <at> gmail.com>
To: 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Wed, 19 Nov 2014 21:19:19 +0000
Glenn's change doesn't completely solve the problem, because
`log-view-goto-rev' goes to the beginning of the buffer when REV is
null, and because all the other callers of `vc-log-internal' are also
affected. It would be better to comment out the `goto-location-func'
call in `vc-log-internal'. Having done that, you will find that you
need to comment out the following line as well, or point will move to
the end of the buffer instead.

Note this is a duplicate of bug 6351.




Forcibly Merged 6351 15322. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 19 Nov 2014 21:35:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Wed, 19 Nov 2014 21:58:02 GMT) Full text and rfc822 format available.

Message #63 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Richard Copley <rcopley <at> gmail.com>
To: 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Wed, 19 Nov 2014 21:57:47 +0000
Having re-read Stefan's comment:

> > It's natural to select a particular
> > revision when running vc-print-log from (say) vc-annotate, but for
> > a plain `C-x v l', the user just wants to see "the log" and presumably
> > doesn't care about which revision happens to be current.

... 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'.

On 19 November 2014 21:19, Richard Copley <rcopley <at> gmail.com> wrote:
> Glenn's change doesn't completely solve the problem, because
> `log-view-goto-rev' goes to the beginning of the buffer when REV is
> null, and because all the other callers of `vc-log-internal' are also
> affected. It would be better to comment out the `goto-location-func'
> call in `vc-log-internal'. Having done that, you will find that you
> need to comment out the following line as well, or point will move to
> the end of the buffer instead.
>
> Note this is a duplicate of bug 6351.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Sun, 03 May 2015 03:33:02 GMT) Full text and rfc822 format available.

Message #66 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Richard Copley <rcopley <at> gmail.com>
Cc: 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Sun, 03 May 2015 06:32:37 +0300
Richard Copley <rcopley <at> gmail.com> 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)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Sun, 03 May 2015 03:39:02 GMT) Full text and rfc822 format available.

Message #69 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Glenn Morris <rgm <at> gnu.org>, Paul Pogonyshev <pogonyshev <at> gmail.com>,
 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Sun, 03 May 2015 06:38:37 +0300
Andreas Schwab <schwab <at> suse.de> writes:

> IMHO scrolling should only happen if point is still at BOB.

While this makes sense, and would help with fixing bug#20470 without
re-introducing the main pain point of this one, we don't have any easy
access to the "current" value of point, neither from
`vc-print-log-internal' (which is called before any output is shown),
nor from within the goto-location-func lambda it passes
`vc-log-internal-common', because the latter is called from
`vc--process-sentinel', after point is temporarily moved to
(process-mark p).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Sun, 03 May 2015 14:35:02 GMT) Full text and rfc822 format available.

Message #72 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: rcopley <at> gmail.com, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Sun, 03 May 2015 17:34:07 +0300
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Sun, 03 May 2015 06:32:37 +0300
> Cc: 15322 <at> debbugs.gnu.org
> 
> @@ -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)))

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.  If it's possible to write a clear and concise
explanation, you don't even need to mention the bug number.  If the
reasons are so complex that they cannot be explained without repeating
too much of the bug discussion, then there should be a summary and a
pointer to the bug.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Sun, 03 May 2015 15:59:02 GMT) Full text and rfc822 format available.

Message #75 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rcopley <at> gmail.com, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Sun, 3 May 2015 18:58:35 +0300
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)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15322; Package emacs. (Sun, 03 May 2015 16:33:02 GMT) Full text and rfc822 format available.

Message #78 received at 15322 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: rcopley <at> gmail.com, 15322 <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Sun, 03 May 2015 19:32:00 +0300
> Cc: rcopley <at> gmail.com, 15322 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Sun, 3 May 2015 18:58:35 +0300
> 
> 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.

Thanks.

>  > 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.

Quite.




Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Sun, 03 May 2015 18:34:01 GMT) Full text and rfc822 format available.

Notification sent to Paul Pogonyshev <pogonyshev <at> gmail.com>:
bug acknowledged by developer. (Sun, 03 May 2015 18:34:02 GMT) Full text and rfc822 format available.

Message #83 received at 15322-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rcopley <at> gmail.com, 15322-done <at> debbugs.gnu.org
Subject: Re: bug#15322: VC log buffer scrolls itself
Date: Sun, 3 May 2015 21:33:46 +0300
Version: 25.1

Thanks for the review, applied.




Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Sun, 03 May 2015 18:34:02 GMT) Full text and rfc822 format available.

Notification sent to Markus Triska <markus.triska <at> gmx.at>:
bug acknowledged by developer. (Sun, 03 May 2015 18:34:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 01 Jun 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 339 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.