Here are some other commands that find matches for a regular
expression. They all ignore case in matching, if the pattern contains
no upper-case letters and
case-fold-search is non-
which always search the whole buffer, all operate on the text from point
to the end of the buffer, or on the region if it is active.
multi-isearch-buffers, except it performs an incremental regexp search.
multi-isearch-files, except it performs an incremental regexp search.
In some modes that set the buffer-local variable
multi-isearch-next-buffer-function (e.g., in Change Log mode)
a multi-file incremental search is activated automatically.
matchface. A numeric argument n specifies that n lines of context are to be displayed before and after each matching line.
The default number of context lines is specified by the variable
list-matching-lines-jump-to-current-line is non-
current line is shown highlighted with face
list-matching-lines-current-line-face and the point is set at
the first match after such line.
You can also run M-s o when an incremental search is active; this uses the current search string.
Note that matches for the regexp you type are extended to include complete lines, and a match that starts before the previous match ends is not considered a match.
In the *Occur* buffer, you can click on each entry, or move
point there and type <RET>, to visit the corresponding position in
the buffer that was searched. o and C-o display the match
in another window; C-o does not select it. Alternatively, you
can use the C-x ` (
next-error) command to visit the
occurrences one by one (see Compilation Mode).
Typing e in the *Occur* buffer switches to Occur Edit mode, in which edits made to the entries are also applied to the text in the originating buffer. Type C-c C-c to return to Occur mode.
The command M-x list-matching-lines is a synonym for M-x occur.
occur, except it is able to search through multiple buffers. It asks you to specify the buffer names one by one.
multi-occur, except the buffers to search are specified by a regular expression that matches visited file names. With a prefix argument, it uses the regular expression to match buffer names instead.
If a match is split across lines,
flush-lines deletes all those
lines. It deletes the lines before starting to look for the next
match; hence, it ignores a match starting on the same line at which
another match ended.
If a match is split across lines, this command keeps all those lines.