]> code.delx.au - gnu-emacs/blobdiff - lispref/positions.texi
* gtkutil.c (xg_tool_bar_detach_callback): Remove unused variable bw.
[gnu-emacs] / lispref / positions.texi
index 72b84a6a0cee0ccad17d27976b08b2034f4af8f7..32e423efdbc93f011480234324cec802a47e589b 100644 (file)
@@ -389,6 +389,7 @@ In an interactive call, @var{count} is the numeric prefix argument.
 
 @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
@@ -403,12 +404,18 @@ Here is an example of using @code{count-lines}:
 (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
@@ -788,15 +795,6 @@ comes back" twice.
 ---------- 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