Subject: Re: bug#35659: 26.1; Weird horizontal scroll behavior with certain settings for `auto-hscroll-mode' and `hscroll-step`.

From: Eli Zaretskii <[email-masked]>
Date: Fri, 10 May 2019 10:14:45 +0300

tags 35659 notabug
thanks

> From: clemera <[email-masked]>
> Date: Thu, 9 May 2019 21:15:26 +0200
> 
> After starting emacs -Q I set the following settings by evaluating them in *scratch*:
> 
> (setq auto-hscroll-mode 'current-line
>       hscroll-step 1
>       truncate-lines t)
> 
> Now after adding a long line right after the above code block (which exceeds the frame width)
> go to the end of the long line. The line scrolls as expected but when you go from there to the lines above, those get
> pushed to the left. I have recorded a gif which shows the described behavior:
> 
> https://imgur.com/a/lJYo4Od

This is the normal behavior of C-n and C-p (UP and DOWN arrow keys):
they try to move into the same column of the next/previous line as the
one of the line you started with.  The rationale is to allow you to
see the same horizontal region in the lines through which you
traverse.  Neither auto-hscroll-mode nor the current-line hscrolling
feature change that basic behavior.

If we were to disable this feature, typing C-n followed by C-p would
not return you back to the same column; you'd need to manually go to
the original column instead.  That'd be an annoyance, I think, as it
would effectively throw away your hscroll each time you move to
another line.

So I don't think there's a bug here.