[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#971: 23.0.60; next-line, previous-line and goal-column

From: Eli Zaretskii
Subject: bug#971: 23.0.60; next-line, previous-line and goal-column
Date: Fri, 16 Sep 2011 12:38:35 +0300

> From: Lars Magne Ingebrigtsen <address@hidden>
> Date: Sun, 11 Sep 2011 19:48:48 +0200
> Cc: address@hidden
> "Roland Winkler" <address@hidden> writes:
> > When goal-column has a value larger than the window width, next line
> > and previous-line behave oddly. Visit file foo.txt, choose a window
> > width of, say, 40, and set goal-column to 50. If initially point is
> > at the beginning of line, next-line and previous-line put point in a
> > column smaller than goal-column. Executing next-line again puts
> > point at the end of the line past goal-column.  
> I can verify that this bug still exists in Emacs 24.

This happens because the (now default) line-move-visual operation of
next-line is fundamentally incompatible with a non-nil setting of
goal-column, when the window with is smaller than goal-column's value.
If you reset line-move-visual to nil, the problem disappears.

line-move-visual (the function) tries to support goal-column, but in a
manner that cannot possibly work when we move by visual lines (as
opposed to logical lines) and the window is too narrow, because visual
lines simply don't have pixel coordinates that correspond to
goal-column in this case.  So it does the best it can: move to the end
of the visual line.

An easy way of solving this is dropping support for goal-column when
line-move-visual is non-nil.  If that's unacceptable, Someoneā„¢ will
have to come up with a specification for what Emacs should do in this
use case, because I cannot think of any reasonable behavior.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]