Besides the usual @code{replace-string} command that finds all
occurrences of one string and replaces them with another, Emacs has a
more flexible replacement command called @code{query-replace}, which
-asks interactively which occurrences to replace.
+asks interactively which occurrences to replace. There are also
+commands to find and operate on all matches for a pattern.
+
+ You can also search multiple files under control of a tags
+table (@pxref{Tags Search}) or through the Dired @kbd{A} command
+(@pxref{Operating on Files}), or ask the @code{grep} program to do it
+(@pxref{Grep Searching}).
+
@menu
* Incremental Search:: Search happens as you type the string.
@node Incremental Search
@section Incremental Search
+@cindex incremental search
+@cindex isearch
An incremental search begins searching as soon as you type the first
character of the search string. As you type in the search string, Emacs
@node Basic Isearch
@subsection Basics of Incremental Search
-@cindex incremental search
@kindex C-s
@findex isearch-forward
@node Non-ASCII Isearch
@subsection Isearch for Non-@acronym{ASCII} Characters
-
@cindex searching for non-@acronym{ASCII} characters
@cindex input method, during incremental search
To enter non-@acronym{ASCII} characters in an incremental search,
-you must use an input method (@pxref{Input Methods}). If an input
-method is enabled in the current buffer when you start the search, you
-can use it while you type the search string also. Emacs indicates
-that by including the input method mnemonic in its prompt, like this:
+you can use @kbd{C-q} (see the previous section), but it is easier to
+use an input method (@pxref{Input Methods}). If an input method is
+enabled in the current buffer when you start the search, you can use
+it in the search string also. Emacs indicates that by including the
+input method mnemonic in its prompt, like this:
@example
I-search [@var{im}]:
@noindent
@findex isearch-toggle-input-method
@findex isearch-toggle-specified-input-method
-where @var{im} is the mnemonic of the active input method. You can
-toggle (enable or disable) the input method while you type the search
-string with @kbd{C-\} (@code{isearch-toggle-input-method}). You can
-turn on a certain (non-default) input method with @kbd{C-^}
+where @var{im} is the mnemonic of the active input method.
+
+ You can toggle (enable or disable) the input method while you type
+the search string with @kbd{C-\} (@code{isearch-toggle-input-method}).
+You can turn on a certain (non-default) input method with @kbd{C-^}
(@code{isearch-toggle-specified-input-method}), which prompts for the
name of the input method. The input method you enable during
incremental search remains enabled in the current buffer afterwards.
@samp{\&} in @var{newstring} stands for the entire match being
replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a
digit, stands for whatever matched the @var{d}th parenthesized
-grouping in @var{regexp}. (This is called a ``back reference''.)
+grouping in @var{regexp}. (This is called a ``back reference.'')
@samp{\#} refers to the count of replacements already made in this
command, as a decimal number. In the first replacement, @samp{\#}
stands for @samp{0}; in the second, for @samp{1}; and so on. For
used the minibuffer to read its arguments. @xref{Repetition, C-x ESC
ESC}.
- See also @ref{Transforming File Names}, for Dired commands to rename,
-copy, or link files by replacing regexp matches in file names.
+ @xref{Operating on Files}, for the Dired @kbd{Q} command which
+performs query replace on selected files. See also @ref{Transforming
+File Names}, for Dired commands to rename, copy, or link files by
+replacing regexp matches in file names.
@node Other Repeating Search
@section Other Search-and-Loop Commands
If a match is split across lines, this command keeps all those lines.
@end table
- You can also search multiple files under control of a tags table
-(@pxref{Tags Search}) or through the Dired @kbd{A} command
-(@pxref{Operating on Files}), or ask the @code{grep} program to do it
-(@pxref{Grep Searching}).
-
@ignore
arch-tag: fd9d8e77-66af-491c-b212-d80999613e3e
@end ignore