]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/searching.texi
Update copyright year to 2016
[gnu-emacs] / doc / lispref / searching.texi
index 2032b151d07561daed959e80f40034f19151e46d..5ff7ef1cf665082edd90d70d0aaaa83ba44bdaf1 100644 (file)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990-1995, 1998-1999, 2001-2015 Free Software
+@c Copyright (C) 1990-1995, 1998-1999, 2001-2016 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Searching and Matching
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Searching and Matching
@@ -113,7 +113,7 @@ match.
 @end deffn
 
 @deffn Command word-search-forward string &optional limit noerror repeat
 @end deffn
 
 @deffn Command word-search-forward string &optional limit noerror repeat
-This function searches forward from point for a ``word'' match for
+This function searches forward from point for a word match for
 @var{string}.  If it finds a match, it sets point to the end of the
 match found, and returns the new value of point.
 
 @var{string}.  If it finds a match, it sets point to the end of the
 match found, and returns the new value of point.
 
@@ -359,7 +359,7 @@ preceding expression either once or not at all.  For example,
 
 @item @samp{*?}, @samp{+?}, @samp{??}
 @cindex non-greedy repetition characters in regexp
 
 @item @samp{*?}, @samp{+?}, @samp{??}
 @cindex non-greedy repetition characters in regexp
-These are ``non-greedy'' variants of the operators @samp{*}, @samp{+}
+These are @dfn{non-greedy} variants of the operators @samp{*}, @samp{+}
 and @samp{?}.  Where those operators match the largest possible
 substring (consistent with matching the entire containing expression),
 the non-greedy variants match the smallest possible substring
 and @samp{?}.  Where those operators match the largest possible
 substring (consistent with matching the entire containing expression),
 the non-greedy variants match the smallest possible substring
@@ -541,11 +541,15 @@ and what they mean:
 @item [:ascii:]
 This matches any @acronym{ASCII} character (codes 0--127).
 @item [:alnum:]
 @item [:ascii:]
 This matches any @acronym{ASCII} character (codes 0--127).
 @item [:alnum:]
-This matches any letter or digit.  (At present, for multibyte
-characters, it matches anything that has word syntax.)
+This matches any letter or digit.  For multibyte characters, it
+matches characters whose Unicode @samp{general-category} property
+(@pxref{Character Properties}) indicates they are alphabetic or
+decimal number characters.
 @item [:alpha:]
 @item [:alpha:]
-This matches any letter.  (At present, for multibyte characters, it
-matches anything that has word syntax.)
+This matches any letter.  For multibyte characters, it matches
+characters whose Unicode @samp{general-category} property
+(@pxref{Character Properties}) indicates they are alphabetic
+characters.
 @item [:blank:]
 This matches space and tab only.
 @item [:cntrl:]
 @item [:blank:]
 This matches space and tab only.
 @item [:cntrl:]
@@ -554,8 +558,11 @@ This matches any @acronym{ASCII} control character.
 This matches @samp{0} through @samp{9}.  Thus, @samp{[-+[:digit:]]}
 matches any digit, as well as @samp{+} and @samp{-}.
 @item [:graph:]
 This matches @samp{0} through @samp{9}.  Thus, @samp{[-+[:digit:]]}
 matches any digit, as well as @samp{+} and @samp{-}.
 @item [:graph:]
-This matches graphic characters---everything except @acronym{ASCII} control
-characters, space, and the delete character.
+This matches graphic characters---everything except whitespace,
+@acronym{ASCII} and non-@acronym{ASCII} control characters,
+surrogates, and codepoints unassigned by Unicode, as indicated by the
+Unicode @samp{general-category} property (@pxref{Character
+Properties}).
 @item [:lower:]
 This matches any lower-case letter, as determined by the current case
 table (@pxref{Case Tables}).  If @code{case-fold-search} is
 @item [:lower:]
 This matches any lower-case letter, as determined by the current case
 table (@pxref{Case Tables}).  If @code{case-fold-search} is
@@ -565,8 +572,8 @@ This matches any multibyte character (@pxref{Text Representations}).
 @item [:nonascii:]
 This matches any non-@acronym{ASCII} character.
 @item [:print:]
 @item [:nonascii:]
 This matches any non-@acronym{ASCII} character.
 @item [:print:]
-This matches printing characters---everything except @acronym{ASCII} control
-characters and the delete character.
+This matches any printing character---either whitespace, or a graphic
+character matched by @samp{[:graph:]}.
 @item [:punct:]
 This matches any punctuation character.  (At present, for multibyte
 characters, it matches anything that has non-word syntax.)
 @item [:punct:]
 This matches any punctuation character.  (At present, for multibyte
 characters, it matches anything that has non-word syntax.)
@@ -988,10 +995,11 @@ list of characters @var{chars}.
 @cindex searching for regexp
 
   In GNU Emacs, you can search for the next match for a regular
 @cindex searching for regexp
 
   In GNU Emacs, you can search for the next match for a regular
-expression either incrementally or not.  For incremental search
-commands, see @ref{Regexp Search, , Regular Expression Search, emacs,
-The GNU Emacs Manual}.  Here we describe only the search functions
-useful in programs.  The principal one is @code{re-search-forward}.
+expression (@pxref{Syntax of Regexps}) either incrementally or not.
+For incremental search commands, see @ref{Regexp Search, , Regular
+Expression Search, emacs, The GNU Emacs Manual}.  Here we describe
+only the search functions useful in programs.  The principal one is
+@code{re-search-forward}.
 
   These search functions convert the regular expression to multibyte if
 the buffer is multibyte; they convert the regular expression to unibyte
 
   These search functions convert the regular expression to multibyte if
 the buffer is multibyte; they convert the regular expression to unibyte
@@ -1094,7 +1102,7 @@ For example,
 The index of the first character of the
 string is 0, the index of the second character is 1, and so on.
 
 The index of the first character of the
 string is 0, the index of the second character is 1, and so on.
 
-After this function returns, the index of the first character beyond
+If this function finds a match, the index of the first character beyond
 the match is available as @code{(match-end 0)}.  @xref{Match Data}.
 
 @example
 the match is available as @code{(match-end 0)}.  @xref{Match Data}.
 
 @example
@@ -1417,8 +1425,9 @@ has no text properties.
 @end defun
 
 @defun match-beginning count
 @end defun
 
 @defun match-beginning count
-This function returns the position of the start of the text matched by the
-last regular expression searched for, or a subexpression of it.
+If the last regular expression search found a match, this function
+returns the position of the start of the matching text or of a
+subexpression of it.
 
 If @var{count} is zero, then the value is the position of the start of
 the entire match.  Otherwise, @var{count} specifies a subexpression in
 
 If @var{count} is zero, then the value is the position of the start of
 the entire match.  Otherwise, @var{count} specifies a subexpression in
@@ -1750,7 +1759,7 @@ in two ways:
 
 @itemize @bullet
 @item
 
 @itemize @bullet
 @item
-The ``key bindings'' are not commands, just symbols that are meaningful
+The key bindings are not commands, just symbols that are meaningful
 to the functions that use this map.
 
 @item
 to the functions that use this map.
 
 @item
@@ -1761,7 +1770,7 @@ event and look it up ``by hand''.
 @end itemize
 @end defvar
 
 @end itemize
 @end defvar
 
-Here are the meaningful ``bindings'' for @code{query-replace-map}.
+Here are the meaningful bindings for @code{query-replace-map}.
 Several of them are meaningful only for @code{query-replace} and
 friends.
 
 Several of them are meaningful only for @code{query-replace} and
 friends.
 
@@ -1826,7 +1835,7 @@ Display some help, then ask again.
 @defvar multi-query-replace-map
 This variable holds a keymap that extends @code{query-replace-map} by
 providing additional keybindings that are useful in multi-buffer
 @defvar multi-query-replace-map
 This variable holds a keymap that extends @code{query-replace-map} by
 providing additional keybindings that are useful in multi-buffer
-replacements.  The additional ``bindings'' are:
+replacements.  The additional bindings are:
 
 @table @code
 @item automatic-all
 
 @table @code
 @item automatic-all