Subject: bug#7910: 23.2; inconsistent scrolling

From: Eli Zaretskii <[email-masked]>
Date: Wed, 09 Dec 2020 17:38:56 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Wed, 09 Dec 2020 13:38:05 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > It's according to the doc string, AFAICT.  If the OP wants the cursor
> > to _always_ retain its screen position, he should set
> > scroll-preserve-screen-position to a non-nil. non-t value.
> 
> Setting the variable to `always' works for me, but the doc string is
> misleading here.
> 
> ---
> A value of t means point keeps its screen position if the scroll
> command moved it vertically out of the window, e.g. when scrolling
> by full screens.
> ---
> 
> If you're on the next-to-last line, `C-v' will not move point out of the
> window -- the next-to-last line will end up as the first line.
> 
> And there's further peculiarities with the t setting -- if you're at the
> next-to-last visual line, `C-v' will put point on the first visual
> line.  `C-v' again, and it's on the next-to-last line again.  So it'll
> alternate first/next-to-last after every `C-v'.

The special "status" of the two lines at bottom is because the default
value of next-screen-context-lines is 2.

It sounds like you did understand the doc string, given your
description.  I wouldn't say it's misleading, just that it only hints
on when screen position will not be kept, instead of describing that
in detail, and in particular doesn't mention
next-screen-context-lines.  Would you like to suggest an amendment to
the doc string that would clarify that?