Fix bug #9607 with vertical motion when auto-hscroll-mode is disabled.

lisp/simple.el (line-move): If auto-hscroll-mode is disabled and the
 window is hscrolled, move by logical lines.
 (line-move-visual): Update the doc string to the above effect.
This commit is contained in:
Eli Zaretskii 2011-09-29 16:03:42 +03:00
parent e785f2ec1d
commit fe5f08dd8f
2 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2011-09-29 Eli Zaretskii <eliz@gnu.org>
* simple.el (line-move): If auto-hscroll-mode is disabled and the
window is hscrolled, move by logical lines. (Bug#9607)
(line-move-visual): Update the doc string to the above effect.
2011-09-29 Martin Rudalics <rudalics@gmx.at>
* window.el (display-buffer-record-window): When WINDOW is the

View file

@ -4244,7 +4244,9 @@ screen, instead of relying on buffer contents alone. It takes
into account variable-width characters and line continuation.
If nil, `line-move' moves point by logical lines.
A non-nil setting of `goal-column' overrides the value of this variable
and forces movement by logical lines."
and forces movement by logical lines.
Disabling `auto-hscroll-mode' also overrides forces movement by logical
lines when the window is horizontally scrolled."
:type 'boolean
:group 'editing-basics
:version "23.1")
@ -4321,7 +4323,15 @@ and forces movement by logical lines."
(not executing-kbd-macro)
(line-move-partial arg noerror to-end))
(set-window-vscroll nil 0 t)
(if (and line-move-visual (not goal-column))
(if (and line-move-visual
;; Display-based column are incompatible with goal-column.
(not goal-column)
;; When auto-hscroll-mode is turned off and the text in
;; the window is scrolled to the left, display-based
;; motion doesn't make sense (because each logical line
;; occupies exactly one screen line).
(not (and (null auto-hscroll-mode)
(> (window-hscroll) 0))))
(line-move-visual arg noerror)
(line-move-1 arg noerror to-end))))