summaryrefslogtreecommitdiff
path: root/doc/lispref
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-05-23 11:03:30 +0300
committerEli Zaretskii <eliz@gnu.org>2015-05-23 11:03:30 +0300
commitd6dfefe40528a6a9ab6d0cbc5f1a450075241141 (patch)
treeae719c9189c8933a946627130a0b19ca731e19c9 /doc/lispref
parenta89ea17be3b589274527bbee6d3c96ff66a226b7 (diff)
downloademacs-d6dfefe40528a6a9ab6d0cbc5f1a450075241141.tar.gz
Fix documentation of forward-line
* src/cmds.c (Fforward_line): Clarify the return value if the line at end of accessible portion of the buffer has no newline. * doc/lispref/positions.texi (Text Lines): Document what happens if the line at end of accessible portion of buffer has no newline. (Bug#20587)
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/positions.texi15
1 files changed, 10 insertions, 5 deletions
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi
index e7c79d58241..c972bbb2e43 100644
--- a/doc/lispref/positions.texi
+++ b/doc/lispref/positions.texi
@@ -350,10 +350,11 @@ would move to.
@deffn Command forward-line &optional count
@cindex beginning of line
This function moves point forward @var{count} lines, to the beginning of
-the line. If @var{count} is negative, it moves point
-@minus{}@var{count} lines backward, to the beginning of a line. If
-@var{count} is zero, it moves point to the beginning of the current
-line. If @var{count} is @code{nil}, that means 1.
+the line following that. If @var{count} is negative, it moves point
+@minus{}@var{count} lines backward, to the beginning of a line
+preceding that. If @var{count} is zero, it moves point to the
+beginning of the current line. If @var{count} is @code{nil}, that
+means 1.
If @code{forward-line} encounters the beginning or end of the buffer (or
of the accessible portion) before finding that many lines, it sets point
@@ -362,7 +363,11 @@ there. No error is signaled.
@code{forward-line} returns the difference between @var{count} and the
number of lines actually moved. If you attempt to move down five lines
from the beginning of a buffer that has only three lines, point stops at
-the end of the last line, and the value will be 2.
+the end of the last line, and the value will be 2. As an explicit
+exception, if the last accessible line is non-empty, but has no
+newline (e.g., if the buffer ends without a newline), the function
+sets point to the end of that line, and the value returned by the
+function counts that line as one line successfully moved.
In an interactive call, @var{count} is the numeric prefix argument.
@end deffn