diff options
| author | Damien Cassou | 2017-04-09 12:46:57 +0200 |
|---|---|---|
| committer | Nicolas Petton | 2017-07-03 14:43:02 +0200 |
| commit | a7754a250b74c17e1f63194e601f20fdb911dd7c (patch) | |
| tree | 965a6cdeff62984195ff7f41fe55d749e200ba3d /doc | |
| parent | 2d846eece7641cbf4ca840f26a835af266d6887e (diff) | |
| download | emacs-a7754a250b74c17e1f63194e601f20fdb911dd7c.tar.gz emacs-a7754a250b74c17e1f63194e601f20fdb911dd7c.zip | |
Add absolute optional parameter to line-number-at-pos (Bug#26417)
* lisp/simple.el (line-number-at-pos): Add a second optional
argument 'absolute'.
* test/list/simple-tests.el: Add tests for 'line-number-at-pos'.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/positions.texi | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index 7c30fe977ca..9fd4bd8fe8e 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi | |||
| @@ -432,11 +432,16 @@ prints a message reporting the number of lines, words, and characters | |||
| 432 | in the buffer, or in the region if the region is active. | 432 | in the buffer, or in the region if the region is active. |
| 433 | @end deffn | 433 | @end deffn |
| 434 | 434 | ||
| 435 | @defun line-number-at-pos &optional pos | 435 | @defun line-number-at-pos &optional pos absolute |
| 436 | @cindex line number | 436 | @cindex line number |
| 437 | This function returns the line number in the current buffer | 437 | This function returns the line number in the current buffer |
| 438 | corresponding to the buffer position @var{pos}. If @var{pos} is @code{nil} | 438 | corresponding to the buffer position @var{pos}. If @var{pos} is |
| 439 | or omitted, the current buffer position is used. | 439 | @code{nil} or omitted, the current buffer position is used. If |
| 440 | @var{absolute} is @code{nil}, the default, counting starts at | ||
| 441 | @code{(point-min)}, so the value refers to the contents of the | ||
| 442 | accessible portion of the (potentially narrowed) buffer. If | ||
| 443 | @var{absolute} is non-@code{nil}, ignore any narrowing and return | ||
| 444 | the absolute line number. | ||
| 440 | @end defun | 445 | @end defun |
| 441 | 446 | ||
| 442 | @ignore | 447 | @ignore |