@defun count-lines start end
@cindex lines in region
+@anchor{Definition of count-lines}
This function returns the number of lines between the positions
@var{start} and @var{end} in the current buffer. If @var{start} and
@var{end} are equal, then it returns 0. Otherwise it returns at least
(defun current-line ()
"Return the vertical position of point@dots{}"
(+ (count-lines (window-start) (point))
- (if (= (current-column) 0) 1 0)
- -1))
+ (if (= (current-column) 0) 1 0)))
@end group
@end example
@end defun
+@defun line-number-at-pos &optional pos
+@cindex line number
+This function returns the line number in the current buffer
+corresponding the buffer position @var{pos}. If @var{pos} is @code{nil}
+or omitted, the current buffer position is used.
+@end defun
+
@ignore
@c ================
The @code{previous-line} and @code{next-line} commands are functions
---------- Buffer: foo ----------
@end group
@end example
-
-Note that char classes are not currently supported in
-@var{character-set}; they will be treated as literals. Thus you
-cannot use @code{"[:alpha:]"} instead of @code{"a-zA-Z"} to include
-non-@acronym{ASCII} letters. A way to skip forward over all letters is:
-
-@example
-(re-search-forward "\\=[[:alpha:]]*" nil t)
-@end example
@end defun
@defun skip-chars-backward character-set &optional limit