diff options
author | Robert Weiner <rsw@gnu.org> | 2020-08-11 16:52:01 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-08-11 16:52:11 +0200 |
commit | 4d4d3e42caca5d823dd66b62f25a1bdd833ba484 (patch) | |
tree | 35c5f7944c61b02807cb1c3d47b753911eb23c55 /doc | |
parent | 119a9ecfe1183f3b6f99a885689d10739687dcc8 (diff) | |
download | emacs-4d4d3e42caca5d823dd66b62f25a1bdd833ba484.tar.gz |
Allow count-lines to ignore invisible lines
* doc/lispref/positions.texi (Text Lines): Document it (bug#23675).
* lisp/simple.el (count-lines): Add an optional parameter to
ignore invisible lines (bug#23675).
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lispref/positions.texi | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index d7856ce73e3..91419702ca1 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -411,7 +411,7 @@ function counts that line as one line successfully moved. In an interactive call, @var{count} is the numeric prefix argument. @end deffn -@defun count-lines start end +@defun count-lines start end &optional ignore-invisible-lines @cindex lines in region @anchor{Definition of count-lines} This function returns the number of lines between the positions @@ -420,6 +420,9 @@ This function returns the number of lines between the positions 1, even if @var{start} and @var{end} are on the same line. This is because the text between them, considered in isolation, must contain at least one line unless it is empty. + +If the optional @var{ignore-invisible-lines} is non-@code{nil}, +invisible lines will not be included in the count. @end defun @deffn Command count-words start end |