unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20470: 24.5; VC log buffer no longer scrolls itself
@ 2015-04-30 13:22 Raoul Gough
  2015-04-30 16:01 ` bug#20470: Acknowledgement (24.5; VC log buffer no longer scrolls itself) Raoul Gough
  2015-05-01 17:53 ` bug#20470: 24.5; VC log buffer no longer scrolls itself Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Raoul Gough @ 2015-04-30 13:22 UTC (permalink / raw)
  To: 20470

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"

Clearly some people don't like the original feature, so I propose that
this feature be made optional instead of unconditionally disabled.

The particular revision control system doesn't really matter, I picked
RCS because it's minimal. If you don't have a file in RCS already, but
have RCS tools installed and a UNIX-like shell, you can do the
following:

$ touch foo
$ ci -l -t-foo foo
$ emacs foo
(then proceed with the C-x v l)



In GNU Emacs 24.5.1 (i686-apple-darwin, NS apple-appkit-1038.36)
 of 2015-04-10 on builder10-6.porkrind.org
Windowing system distributor `Apple', version 10.3.1038
Configured using:
 `configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --host=i686-apple-darwin
 --build=i686-apple-darwin --with-jpeg=no --with-png=no --with-gif=no
 --with-tiff=no'

Important settings:
  locale-coding-system: utf-8-unix

Major mode: Log-View

Minor modes in effect:
  iswitchb-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Type C-x 1 to delete the help window.
Quit
Setting up indent for shell type sh
Indentation variables are now local.
Indentation setup for shell type sh
Mark set [2 times]
Beginning of buffer [5 times]
End of buffer [2 times]
Beginning of buffer [4 times]
<A-C-M-drag-n-drop> is undefined

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils log-view easy-mmode pcvs-util vc vc-dispatcher
vc-rcs sh-script smie executable help-mode help-fns edmacro kmacro
iswitchb delsel python easymenu json comint ansi-color ring desktop
frameset cl-loaddefs cl-lib rmg-utils time-date tooltip electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
cocoa ns multi-tty emacs)

Memory information:
((conses 8 91293 3952)
 (symbols 24 19601 0)
 (miscs 20 109 177)
 (strings 16 17438 3541)
 (string-bytes 1 507342)
 (vectors 8 12412)
 (vector-slots 4 421722 3144)
 (floats 8 62 522)
 (intervals 28 278 6)
 (buffers 512 15))






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#20470: Acknowledgement (24.5; VC log buffer no longer scrolls itself)
  2015-04-30 13:22 bug#20470: 24.5; VC log buffer no longer scrolls itself Raoul Gough
@ 2015-04-30 16:01 ` Raoul Gough
  2015-05-01 17:53 ` bug#20470: 24.5; VC log buffer no longer scrolls itself Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Raoul Gough @ 2015-04-30 16:01 UTC (permalink / raw)
  To: 20470

[-- Attachment #1: Type: text/plain, Size: 112 bytes --]

I've attached a propose patch to fix this bug, which makes the jump-to-revision configurable (defaulting to off)

[-- Attachment #2: vc.el.20470.patch --]
[-- Type: application/octet-stream, Size: 1213 bytes --]

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index bb4dd60..409a1d8 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -807,6 +807,17 @@ Not all VC backends are able to support this feature."
   :type 'integer
   :group 'vc)
 
+(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.
+
+Jumping to the current revision was the default behaviour until
+emacs 24.4 where it was disabled unconditionally. Now it is
+configurable."
+  :type 'boolean
+  :group 'vc
+  :version "25.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
@@ -2304,7 +2315,7 @@ WORKING-REVISION and LIMIT."
   (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)))
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#20470: 24.5; VC log buffer no longer scrolls itself
  2015-04-30 13:22 bug#20470: 24.5; VC log buffer no longer scrolls itself Raoul Gough
  2015-04-30 16:01 ` bug#20470: Acknowledgement (24.5; VC log buffer no longer scrolls itself) Raoul Gough
@ 2015-05-01 17:53 ` Stefan Monnier
  2020-08-25  9:22   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2015-05-01 17:53 UTC (permalink / raw)
  To: Raoul Gough; +Cc: 20470

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

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


        Stefan





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#20470: 24.5; VC log buffer no longer scrolls itself
  2015-05-01 17:53 ` bug#20470: 24.5; VC log buffer no longer scrolls itself Stefan Monnier
@ 2020-08-25  9:22   ` Lars Ingebrigtsen
  2020-08-25 18:30     ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-25  9:22 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 20470, Raoul Gough

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





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#20470: 24.5; VC log buffer no longer scrolls itself
  2020-08-25  9:22   ` Lars Ingebrigtsen
@ 2020-08-25 18:30     ` Juri Linkov
  2020-10-11  3:18       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2020-08-25 18:30 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 20470, Stefan Monnier, Raoul Gough

> 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")

I think such option makes more sense in context of https://debbugs.gnu.org/35624#66
that proposed to insert a header line for the current working revision
where you can type 'D' to diff the working revision in vc-git logs.

But I'm still not sure whether such option is needed at all since
the long-established behavior is just to jump to the latest revision
that should be followed in all VCSs.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#20470: 24.5; VC log buffer no longer scrolls itself
  2020-08-25 18:30     ` Juri Linkov
@ 2020-10-11  3:18       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-11  3:18 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 20470, Stefan Monnier, Raoul Gough

Juri Linkov <juri@linkov.net> writes:

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

[...]

>> +(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")
>
> I think such option makes more sense in context of
> https://debbugs.gnu.org/35624#66
> that proposed to insert a header line for the current working revision
> where you can type 'D' to diff the working revision in vc-git logs.
>
> But I'm still not sure whether such option is needed at all since
> the long-established behavior is just to jump to the latest revision
> that should be followed in all VCSs.

Yeah, the issue is mainly whether that's nice as a user interface, since
the buffer is created asynchronously, and then skipping around is
problematic (see bug#15322).

Since this only affects CVS and RCS, but the proposed fix has wider
ramifications, I'm closing this as a wontfix.

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-11  3:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30 13:22 bug#20470: 24.5; VC log buffer no longer scrolls itself Raoul Gough
2015-04-30 16:01 ` bug#20470: Acknowledgement (24.5; VC log buffer no longer scrolls itself) Raoul Gough
2015-05-01 17:53 ` bug#20470: 24.5; VC log buffer no longer scrolls itself Stefan Monnier
2020-08-25  9:22   ` Lars Ingebrigtsen
2020-08-25 18:30     ` Juri Linkov
2020-10-11  3:18       ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).