From: Eli Zaretskii Date: Thu, 29 Sep 2011 13:03:42 +0000 (+0300) Subject: Fix bug #9607 with vertical motion when auto-hscroll-mode is disabled. X-Git-Tag: emacs-pretest-24.0.91~246 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fe5f08dd8f85e6ede64ed0c8406b78e7940662a2;p=emacs.git 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b217a9093f6..42bd14094ba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-09-29 Eli Zaretskii + + * 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 * window.el (display-buffer-record-window): When WINDOW is the diff --git a/lisp/simple.el b/lisp/simple.el index 14ce5ed18ec..1ab90792bfa 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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))))