15.2 Nonincremental Search
Emacs also has conventional nonincremental search commands, which require you to type the entire search string before searching begins.
C-s RET string RET
β
Search for string
.
C-r RET string RET
β
Search backward for string
.
To start a nonincremental search, first type C-s RET
. This enters the minibuffer to read the search string; terminate the string with RET
, and then the search takes place. If the string is not found, the search command signals an error.
When you type C-s RET
, the C-s
invokes incremental search as usual. That command is specially programmed to invoke the command for nonincremental search, if the string you specify is empty. (Such an empty argument would otherwise be useless.) C-r RET
does likewise, invoking the nonincremental backward-searching command.
Nonincremental search can also be invoked from the menu barβs βEdit->Search
β menu.
You can also use two simpler commands, M-x search-forward
and M-x search-backward
. These commands look for the literal strings you specify, and donβt support any of the lax-search features (see Lax Search) except case folding.