+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
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")
(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))))