@c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2012
-@c Free Software Foundation, Inc.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2013 Free Software
+@c Foundation, Inc.
@c See file emacs.texi for copying conditions.
@node Search
@chapter Searching and Replacement
@end table
@menu
-* Basic Isearch:: Basic incremental search commands.
-* Repeat Isearch:: Searching for the same string again.
-* Error in Isearch:: When your string is not found.
-* Special Isearch:: Special input in incremental search.
-* Isearch Yank:: Commands that grab text into the search string
- or else edit the search string.
-* Isearch Scroll:: Scrolling during an incremental search.
-* Isearch Minibuffer:: Incremental search of the minibuffer history.
+* Basic Isearch:: Basic incremental search commands.
+* Repeat Isearch:: Searching for the same string again.
+* Error in Isearch:: When your string is not found.
+* Special Isearch:: Special input in incremental search.
+* Isearch Yank:: Commands that grab text into the search string
+ or else edit the search string.
+* Not Exiting Isearch:: Prefix argument and scrolling commands.
+* Isearch Minibuffer:: Incremental search of the minibuffer history.
@end menu
@node Basic Isearch
@kindex M-e @r{(Incremental search)}
To edit the current search string in the minibuffer without
-replacing it with items from the search ring, type @kbd{M-e}. Type
+replacing it with items from the search ring, type @kbd{M-e}. Type @key{RET},
@kbd{C-s} or @kbd{C-r} to finish editing the string and search for it.
@node Error in Isearch
@kindex M-% @r{(Incremental search)}
Typing @kbd{M-%} in incremental search invokes @code{query-replace}
or @code{query-replace-regexp} (depending on search mode) with the
-current search string used as the string to replace. @xref{Query
-Replace}.
+current search string used as the string to replace. A negative
+prefix argument means to replace backward. @xref{Query Replace}.
@kindex M-TAB @r{(Incremental search)}
Typing @kbd{M-@key{TAB}} in incremental search invokes
minibuffer with @kbd{M-e} (@pxref{Repeat Isearch}) and type @kbd{C-f}
at the end of the search string in the minibuffer.
-@node Isearch Scroll
-@subsection Scrolling During Incremental Search
+@node Not Exiting Isearch
+@subsection Not Exiting Incremental Search
+This subsection describes two categories of commands which you can
+type without exiting the current incremental search, even though they
+are not themselves part of incremental search.
+
+@table @asis
+@item Prefix Arguments
+@vindex isearch-allow-prefix
+ In incremental search, when you enter a prefix argument
+(@pxref{Arguments}), by default it will apply either to the next
+action in the search or to the command that exits the search.
+
+ In previous versions of Emacs, entering a prefix argument always
+terminated the search. You can revert to this behavior by setting the
+variable @code{isearch-allow-prefix} to @code{nil}.
+
+ When @code{isearch-allow-scroll} is non-@code{nil} (see below),
+prefix arguments always have the default behavior described above.
+
+@item Scrolling Commands
@vindex isearch-allow-scroll
Normally, scrolling commands exit incremental search. If you change
the variable @code{isearch-allow-scroll} to a non-@code{nil} value,
change point, the buffer contents, the match data, the current buffer,
or the selected window and frame. The command must not itself attempt
an incremental search.
+@end table
@node Isearch Minibuffer
@subsection Searching the Minibuffer
If incremental search is active, toggle symbol search mode
(@code{isearch-toggle-symbol}); otherwise, begin an incremental
forward symbol search (@code{isearch-forward-symbol}).
+@item M-s .
+Start a symbol incremental search forward with the symbol found near
+point added to the search string initially.
@item M-s _ @key{RET} @var{symbol} @key{RET}
Search forward for @var{symbol}, nonincrementally.
@item M-s _ C-r @key{RET} @var{symbol} @key{RET}
@end table
@kindex M-s _
+@kindex M-s .
@findex isearch-forward-symbol
- To begin a forward incremental symbol search, type @kbd{M-s _}. If
-incremental search is not already active, this runs the command
+@findex isearch-forward-symbol-at-point
+ To begin a forward incremental symbol search, type @kbd{M-s _} (or
+@kbd{M-s .} if the symbol to search is near point). If incremental
+search is not already active, this runs the command
@code{isearch-forward-symbol}. If incremental search is already
active, @kbd{M-s _} switches to a symbol search, preserving the
direction of the search and the current search string; you can disable
tries to match all three @samp{a}s; but the rest of the pattern is
@samp{ar} and there is only @samp{r} left to match, so this try fails.
The next alternative is for @samp{a*} to match only two @samp{a}s.
-With this choice, the rest of the regexp matches successfully.@refill
+With this choice, the rest of the regexp matches successfully.
@item @kbd{+}
is a postfix operator, similar to @samp{*} except that it must match
match @var{a}, and if that fails, by trying to match @var{b}.
Thus, @samp{foo\|bar} matches either @samp{foo} or @samp{bar}
-but no other string.@refill
+but no other string.
@samp{\|} applies to the largest possible surrounding expressions. Only a
surrounding @samp{\( @dots{} \)} grouping can limit the grouping power of
-@samp{\|}.@refill
+@samp{\|}.
Full backtracking capability exists to handle multiple uses of @samp{\|}.
To enclose a complicated expression for the postfix operators @samp{*},
@samp{+} and @samp{?} to operate on. Thus, @samp{ba\(na\)*} matches
@samp{bananana}, etc., with any (zero or more) number of @samp{na}
-strings.@refill
+strings.
@item
To record a matched substring for future reference.
matches the empty string, but only at the beginning or
end of a word. Thus, @samp{\bfoo\b} matches any occurrence of
@samp{foo} as a separate word. @samp{\bballs?\b} matches
-@samp{ball} or @samp{balls} as a separate word.@refill
+@samp{ball} or @samp{balls} as a separate word.
@samp{\b} matches at the beginning or end of the buffer
regardless of what text appears next to it.
you specify searching for @samp{foo}, then @samp{Foo} and @samp{foo}
also match. Regexps, and in particular character sets, behave
likewise: @samp{[ab]} matches @samp{a} or @samp{A} or @samp{b} or
-@samp{B}.@refill
+@samp{B}.
An upper-case letter anywhere in the incremental search string makes
the search case-sensitive. Thus, searching for @samp{Foo} does not find
(@pxref{Unconditional Replace}). In particular, it preserves case
provided @code{case-replace} is non-@code{nil}, as it normally is
(@pxref{Replacement and Case}). A numeric argument means to consider
-only occurrences that are bounded by word-delimiter characters.
+only occurrences that are bounded by word-delimiter characters. A
+negative prefix argument replaces backward.
@kindex C-M-%
@findex query-replace-regexp