From: Eli Zaretskii Date: Fri, 25 Oct 2013 09:45:51 +0000 (+0300) Subject: Fix bug #15712 with vertical motion when the goal column needs to hscroll. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1132 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fbfd0e1d751dd142064b9aaebbf71818d99ae5f1;p=emacs.git Fix bug #15712 with vertical motion when the goal column needs to hscroll. lisp/simple.el (line-move): Call line-move-1 instead of line-move-visual when the current window hscroll is zero, but temporary-goal-column indicates we will need to hscroll as result of the movement. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07de60c735d..c7da1c86416 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-10-25 Eli Zaretskii + + * simple.el (line-move): Call line-move-1 instead of + line-move-visual when the current window hscroll is zero, but + temporary-goal-column indicates we will need to hscroll as result + of the movement. (Bug#15712) + 2013-10-25 Dmitry Gutov * progmodes/ruby-mode.el (ruby-mode-menu): Use proper diff --git a/lisp/simple.el b/lisp/simple.el index 3fefce15d2a..1f1b5cb376f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4908,7 +4908,16 @@ The value is a floating-point number." ;; When 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 (> (window-hscroll) 0))) + (not (> (window-hscroll) 0)) + ;; Likewise when the text _was_ scrolled to the left + ;; when the current run of vertical motion commands + ;; started. + (not (and (memq last-command + `(next-line previous-line ,this-command)) + auto-hscroll-mode + (numberp temporary-goal-column) + (>= temporary-goal-column + (- (window-width) hscroll-margin))))) (prog1 (line-move-visual arg noerror) ;; If we moved into a tall line, set vscroll to make ;; scrolling through tall images more smooth.