A symbol search is much like an ordinary search, except that
the boundaries of the search must match the boundaries of a symbol.
The meaning of symbol in this context depends on the major mode,
and usually refers to a source code token, such as a Lisp symbol in
Emacs Lisp mode. For instance, if you perform an incremental symbol
search for the Lisp symbol
forward-word, it would not match
isearch-forward-word. This feature is thus mainly useful for
searching source code.
isearch-toggle-symbol); otherwise, begin an incremental forward symbol search (
To begin a forward incremental symbol search, type M-s _ (or
M-s . if the symbol to search is near point). If incremental
search is not already active, this runs the command
isearch-forward-symbol. If incremental search is already
active, M-s _ switches to a symbol search, preserving the
direction of the search and the current search string; you can disable
symbol search by typing M-s _ again. In incremental symbol
search, while you are typing the search string, only the beginning
of the search string is required to match the beginning of a symbol,
and ‘Pending’ appears in the search prompt until you use a search
repeating key like C-s.
To begin a nonincremental symbol search, type M-s _ <RET> for a forward search, or M-s _ C-r <RET> or a backward search. In nonincremental symbol searches, the beginning and end of the search string are required to match the beginning and end of a symbol, respectively.
The symbol search commands don't perform character folding, and toggling lax whitespace matching (see lax space matching) has no effect on them.