Improve documentation of Occur mode

* doc/emacs/search.texi (Other Repeating Search): Improve wording
and document Occur Edit mode better.
This commit is contained in:
Eli Zaretskii 2022-01-29 16:51:30 +02:00
parent 611736f3bc
commit 5ef3a52342

View file

@ -1860,12 +1860,12 @@ replacing regexp matches in file names.
@node Other Repeating Search @node Other Repeating Search
@section Other Search-and-Loop Commands @section Other Search-and-Loop Commands
Here are some other commands that find matches for a regular Here are some other commands that find matches for regular
expression. They all ignore case in matching, if the pattern contains expressions. They all ignore case in matching, if the pattern contains
no upper-case letters and @code{case-fold-search} is non-@code{nil}. no upper-case letters and @code{case-fold-search} is non-@code{nil}.
Aside from @code{multi-occur} and @code{multi-occur-in-matching-buffers}, Aside from @code{multi-occur} and @code{multi-occur-in-matching-buffers},
which always search the whole buffer, all operate on the text from point which always search the whole buffer, all of the commands operate on the
to the end of the buffer, or on the region if it is active. text from point to the end of the buffer, or on the region if it is active.
@table @kbd @table @kbd
@findex multi-isearch-buffers @findex multi-isearch-buffers
@ -1939,19 +1939,27 @@ is not considered a match.
@kindex RET @r{(Occur mode)} @kindex RET @r{(Occur mode)}
@kindex o @r{(Occur mode)} @kindex o @r{(Occur mode)}
@kindex C-o @r{(Occur mode)} @kindex C-o @r{(Occur mode)}
In the @file{*Occur*} buffer, you can click on each entry, or move The @file{*Occur*} buffer uses the Occur mode as its major mode. You
point there and type @key{RET}, to visit the corresponding position in can use the @kbd{n} and @kbd{p} keys to move to the next or previous
the buffer that was searched. @kbd{o} and @kbd{C-o} display the match match; with prefix numeric argument, these commands move that many
in another window; @kbd{C-o} does not select it. Alternatively, you matches. Digit keys are bound to @code{digit-argument}, so @kbd{5 n}
can use the @kbd{M-g M-n} (@code{next-error}) command to visit the moves to the fifth next match (you don't have to type @kbd{C-u}).
occurrences one by one (@pxref{Compilation Mode}). @key{SPC} and @key{DEL} scroll the @file{*Occur*} buffer up and down.
Clicking on a match or moving point there and typing @key{RET} visits
the corresponding position in the original buffer that was searched.
@kbd{o} and @kbd{C-o} display the match in another window; @kbd{C-o}
does not select that window. Alternatively, you can use the @kbd{M-g
M-n} (@code{next-error}) command to visit the occurrences one by one
(@pxref{Compilation Mode}). Finally, @kbd{q} quits the window showing
the @file{*Occur*} buffer and buries the buffer.
@cindex Occur Edit mode @cindex Occur Edit mode
@cindex mode, Occur Edit @cindex mode, Occur Edit
Typing @kbd{e} in the @file{*Occur*} buffer switches to Occur Edit Typing @kbd{e} in the @file{*Occur*} buffer makes the buffer writable
mode, in which edits made to the entries are also applied to the text and enters the Occur Edit mode, in which you can edit the matching
in the originating buffer. Type @kbd{C-c C-c} to return to Occur lines and have those edits reflected in the text in the originating
mode. buffer. Type @kbd{C-c C-c} to leave the Occur Edit mode and return to
the Occur mode.
@findex list-matching-lines @findex list-matching-lines
The command @kbd{M-x list-matching-lines} is a synonym for @kbd{M-x The command @kbd{M-x list-matching-lines} is a synonym for @kbd{M-x