; Improve documentation of 'vertical-motion' in ELisp manual

* doc/lispref/positions.texi (Screen Lines): Improve the
documentation of 'vertical-motion'.
This commit is contained in:
Eli Zaretskii 2023-07-07 09:26:58 +03:00
parent 0d90873fa4
commit 502a780031

View file

@ -560,16 +560,23 @@ improve the performance of your code. @xref{Truncation, cache-long-scans}.
@defun vertical-motion count &optional window cur-col @defun vertical-motion count &optional window cur-col
This function moves point to the start of the screen line @var{count} This function moves point to the start of the screen line @var{count}
screen lines down from the screen line containing point. If @var{count} screen lines down from the screen line containing point. If @var{count}
is negative, it moves up instead. is negative, it moves up instead. If @var{count} is zero, point moves
to the visual start of the current screen line.
The @var{count} argument can be a cons cell, @code{(@var{cols} The @var{count} argument can be a cons cell, @w{@code{(@var{cols}
. @var{lines})}, instead of an integer. Then the function moves by . @var{lines})}}, instead of an integer. Then the function moves by
@var{lines} screen lines, and puts point @var{cols} columns from the @var{lines} screen lines, as described for @var{count} above, and puts
visual start of that screen line. Note that @var{cols} are counted point @var{cols} columns from the visual start of that screen line.
from the @emph{visual} start of the line; if the window is scrolled The value of @var{cols} can be a float, and is interpreted in units of
horizontally (@pxref{Horizontal Scrolling}), the column on which point the frame's canonical character width (@pxref{Frame Font}); this
will end is in addition to the number of columns by which the text is allows specifying accurate horizontal position of point when the
scrolled. target screen line uses variable fonts. Note that @var{cols} are
counted from the @emph{visual} start of the line; if the window is
scrolled horizontally (@pxref{Horizontal Scrolling}), the column where
point will end is in addition to the number of columns by which the
text is scrolled, and if the target line is a continuation line, its
leftmost column is considered column zero (unlike column-oriented
functions, @pxref{Columns}).
The return value is the number of screen lines over which point was The return value is the number of screen lines over which point was
moved. The value may be less in absolute value than @var{count} if moved. The value may be less in absolute value than @var{count} if