Subject: bug#9607: incorrect behavior with "auto-hscroll-mode nil" in ncurses/vt220 text operation; wrong in 23 but ok in 22.1

From: Eli Zaretskii <[email-masked]>
Date: Tue, 27 Sep 2011 02:07:20 -0400

> From: Glenn Morris <[email-masked]>
> Date: Tue, 27 Sep 2011 00:01:50 -0400
> Cc: David Lawless <[email-masked]>
> 
> emacs -Q --eval '(setq auto-hscroll-mode nil)'
> 
> Evaluate:
> (dotimes (j 5)
>   (insert "\n")
>   (dotimes (i 10)
>     (insert "0123456890 ")))
> 
> Put point at start of first line of digits.
> M-x scroll-left RET y
> ;; Window now scrolled to right-hand end of lines
> Down arrow  ; first time is ok
> Down arrow
>   -> second time window scrolls back to left-hand end of line
> 
> 
> (setq line-move-visual nil)
> 
> avoids the problem.
> 
> I guess it's related to the 2009-07 changes to line-move-visual for hscroll.

The problem is that line-move-visual assumes that the move begins with
cursor positioned at point, which is false when auto-hscroll-mode is
turned off and point is scrolled out of view.

Before I dive into this mess (again), do we even want to support
auto-hscroll-mode nil _and_ visual line movement?  What if we tell
line-move to invoke logical line movement instead when
auto-hscroll-mode is off?  Would someone object?