aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDamien Cassou2017-04-09 12:46:57 +0200
committerNicolas Petton2017-07-03 14:43:02 +0200
commita7754a250b74c17e1f63194e601f20fdb911dd7c (patch)
tree965a6cdeff62984195ff7f41fe55d749e200ba3d /doc
parent2d846eece7641cbf4ca840f26a835af266d6887e (diff)
downloademacs-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.texi11
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
432in the buffer, or in the region if the region is active. 432in 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
437This function returns the line number in the current buffer 437This function returns the line number in the current buffer
438corresponding to the buffer position @var{pos}. If @var{pos} is @code{nil} 438corresponding to the buffer position @var{pos}. If @var{pos} is
439or 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
442accessible portion of the (potentially narrowed) buffer. If
443@var{absolute} is non-@code{nil}, ignore any narrowing and return
444the absolute line number.
440@end defun 445@end defun
441 446
442@ignore 447@ignore