aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fns.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/fns.c b/src/fns.c
index 41429c8863d..e2442685732 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -5892,12 +5892,14 @@ in OBJECT. */)
5892 5892
5893DEFUN ("line-number-at-pos", Fline_number_at_pos, 5893DEFUN ("line-number-at-pos", Fline_number_at_pos,
5894 Sline_number_at_pos, 0, 2, 0, 5894 Sline_number_at_pos, 0, 2, 0,
5895 doc: /* Return the line number at POSITION. 5895 doc: /* Return the line number at POSITION in the current buffer.
5896If POSITION is nil, use the current buffer location. 5896If POSITION is nil or omitted, it defaults to point's position in the
5897 5897current buffer.
5898If the buffer is narrowed, the position returned is the position in the 5898
5899visible part of the buffer. If ABSOLUTE is non-nil, count the lines 5899If the buffer is narrowed, the return value by default counts the lines
5900from the absolute start of the buffer. */) 5900from the beginning of the accessible portion of the buffer. But if the
5901second optional argument ABSOLUTE is non-nil, the value counts the lines
5902from the absolute start of the buffer, disregarding the narrowing. */)
5901 (register Lisp_Object position, Lisp_Object absolute) 5903 (register Lisp_Object position, Lisp_Object absolute)
5902{ 5904{
5903 ptrdiff_t pos, start = BEGV_BYTE; 5905 ptrdiff_t pos, start = BEGV_BYTE;
@@ -5915,7 +5917,7 @@ from the absolute start of the buffer. */)
5915 if (!NILP (absolute)) 5917 if (!NILP (absolute))
5916 start = BEG_BYTE; 5918 start = BEG_BYTE;
5917 5919
5918 /* Check that POSITION is n the visible range of the buffer. */ 5920 /* Check that POSITION is in the accessible range of the buffer. */
5919 if (pos < BEGV || pos > ZV) 5921 if (pos < BEGV || pos > ZV)
5920 args_out_of_range (make_int (start), make_int (ZV)); 5922 args_out_of_range (make_int (start), make_int (ZV));
5921 5923