]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/searching.texi
; Merge from origin/emacs-25
[gnu-emacs] / doc / lispref / searching.texi
index 87513e8f9ce252bc2effd5ef03694f7c4345eb72..644716a95c7165c7003413ad3f725cbdfa7d369e 100644 (file)
@@ -1,6 +1,6 @@
 @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
@@ -113,7 +113,7 @@ match.
 @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.
 
@@ -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
-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
@@ -558,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 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
@@ -569,8 +572,8 @@ This matches any multibyte character (@pxref{Text Representations}).
 @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.)
@@ -1099,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.
 
-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
@@ -1148,16 +1151,17 @@ comes back" twice.
 @end example
 @end defun
 
-@defun looking-back regexp &optional limit greedy
+@defun looking-back regexp limit &optional greedy
 This function returns @code{t} if @var{regexp} matches the text
 immediately before point (i.e., ending at point), and @code{nil} otherwise.
 
 Because regular expression matching works only going forward, this is
 implemented by searching backwards from point for a match that ends at
 point.  That can be quite slow if it has to search a long distance.
-You can bound the time required by specifying @var{limit}, which says
-not to search before @var{limit}.  In this case, the match that is
-found must begin at or after @var{limit}.  Here's an example:
+You can bound the time required by specifying a non-@code{nil} value
+for @var{limit}, which says not to search before @var{limit}.  In this
+case, the match that is found must begin at or after @var{limit}.
+Here's an example:
 
 @example
 @group
@@ -1175,9 +1179,9 @@ comes back" twice.
 
 If @var{greedy} is non-@code{nil}, this function extends the match
 backwards as far as possible, stopping when a single additional
-previous character cannot be part of a match for regexp.  When the
-match is extended, its starting position is allowed to occur before
-@var{limit}.
+previous character cannot be part of a match for @var{regexp}.  When
+the match is extended, its starting position is allowed to occur
+before @var{limit}.
 
 @c http://debbugs.gnu.org/5689
 As a general recommendation, try to avoid using @code{looking-back}
@@ -1422,8 +1426,9 @@ has no text properties.
 @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
@@ -1755,7 +1760,7 @@ in two ways:
 
 @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
@@ -1766,7 +1771,7 @@ event and look it up ``by hand''.
 @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.
 
@@ -1800,6 +1805,14 @@ Answer this question and all subsequent questions in the series with
 @item backup
 Move back to the previous place that a question was asked about.
 
+@item undo
+Undo last replacement and move back to the place where that
+replacement was performed.
+
+@item undo-all
+Undo all replacements and move back to the place where the first
+replacement was performed.
+
 @item edit
 Enter a recursive edit to deal with this question---instead of any
 other action that would normally be taken.
@@ -1831,7 +1844,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
-replacements.  The additional ``bindings'' are:
+replacements.  The additional bindings are:
 
 @table @code
 @item automatic-all