diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 16 |
1 files changed, 9 insertions, 7 deletions
| @@ -5892,12 +5892,14 @@ in OBJECT. */) | |||
| 5892 | 5892 | ||
| 5893 | DEFUN ("line-number-at-pos", Fline_number_at_pos, | 5893 | DEFUN ("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. |
| 5896 | If POSITION is nil, use the current buffer location. | 5896 | If POSITION is nil or omitted, it defaults to point's position in the |
| 5897 | 5897 | current buffer. | |
| 5898 | If the buffer is narrowed, the position returned is the position in the | 5898 | |
| 5899 | visible part of the buffer. If ABSOLUTE is non-nil, count the lines | 5899 | If the buffer is narrowed, the return value by default counts the lines |
| 5900 | from the absolute start of the buffer. */) | 5900 | from the beginning of the accessible portion of the buffer. But if the |
| 5901 | second optional argument ABSOLUTE is non-nil, the value counts the lines | ||
| 5902 | from 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 | ||