bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20470: 24.5; VC log buffer no longer scrolls itself


From: Lars Ingebrigtsen
Subject: bug#20470: 24.5; VC log buffer no longer scrolls itself
Date: Tue, 25 Aug 2020 11:22:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> How to reproduce: open a file checked out from RCS, hit C-x v l (or
>> equivalently M-x vc-print-log RET) and notice that the cursor ends up at
>> the start of the *vc-change-log* buffer. It should jump to the log
>> message for the current revision, which was the case until the fix for
>> bug #15322 "VC log buffer scrolls itself"
>
> How far are the two positions?  What's between them?

I'm popped to a buffer containing this, and point is at the start of the
buffer.  So the revision itself is way down there:

RCS file: foo,v
Working file: foo
head: 1.1
branch:
locks: strict
        larsi: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;     selected revisions: 1
description:
foo
----------------------------
revision 1.1    locked by: larsi;
date: 2020/08/25 09:15:10;  author: larsi;  state: Exp;
Initial revision

>> The particular revision control system doesn't really matter,
>
> I'm beginning to suspect it does.  IIRC RCS (and CVS) put a bunch of
> file-level metadata before the actual log, whereas other VCSes just put
> the log right away.  So for RCS/CVS it might make sense to skip to the
> first actual log message, so as to reproduce the behavior of
> other backends.
>
> Skipping to the log message corresponding to "the current revision"
> seems much less important (and this is the part that was problematic
> with the old behavior).

Yes, I think so too.  I this only makes much of a difference for
rcs/cvs, so I'm not sure it worth adding this?  Not many people use
those these days...

I've respun the patch for Emacs 28, though.

Apply the patch or close the bug as a "wontfix"?

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 5561292d8c..6dad0cf83a 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -817,6 +817,12 @@ vc-log-show-limit
 Not all VC backends are able to support this feature."
   :type 'integer)
 
+(defcustom vc-log-jump-to-current nil
+  "If non-nil, `vc-print-log' moves point automatically to the
+log message for the current working revision."
+  :type 'boolean
+  :version "28.1")
+
 (defcustom vc-allow-async-revert nil
   "Specifies whether the diff during \\[vc-revert] may be asynchronous.
 Enabling this option means that you can confirm a revert operation even
@@ -2502,8 +2508,9 @@ vc-print-log
   (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))))
-         )
+         (working-revision
+          (or working-revision
+              (and vc-log-jump-to-current (vc-working-revision (car files))))))
     (vc-print-log-internal backend files working-revision nil limit)))
 
 ;;;###autoload

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]