Subject: bug#27008: 26.0.50; auto-hscroll-mode and scroll-left

From: Eli Zaretskii <[email-masked]>
Date: Sun, 21 May 2017 18:23:10 +0300

> From: Stephen Berman <[email-masked]>
> Date: Sun, 21 May 2017 16:10:04 +0200
> 
> When auto-hscroll-mode is set to `current-line' and scroll-left is
> invoked with arguments ARG > 0 and SET-MINIMUM non-nil, then when the
> current line is automatically horizontally scrolled, all other lines in
> the buffer are scrolled back to logical BOL, i.e. SET-MINIMUM is ignored
> (except on the current line).  To reproduce:
> 
> 0. emacs -Q
> 1. Set auto-hscroll-mode to `current-line'.
> 2. Type `C-x C-f /path/to/hscroll-bug RET' (the attached file).
> 3. Type `M-x toggle-truncate-lines' and `M-: (scroll-left 32 t)'.
> 4. Type `C-p' repeatedly.
> => When point is on the third line, and for all subsequent vertical
>    motion, all lines but the current one are displayed starting at BOL
>    instead of column SET-MINIMUM.

I don't understand what you expected instead.  current-line hscrolling
is designed to be disabled when manual scrolling is used, so using
scroll-left is incompatible with automatic hscrolling and should have
disabled it.  If anything, I could understand a complaint that the
current line is still hscrolled in this recipe, but otherwise I think
your expectations are a tad too much; the effect you describe is more
or less what I intended to happen.

Technically, the minimum hscroll is implemented by the same code which
calculates the window's hscroll value upon redisplay, and in
current-line hscrolling that value affects only the current line, the
rest of the window is displayed as if the hscroll is zero.