aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/search.texi61
1 files changed, 30 insertions, 31 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 176bbdaa884..979d6670f57 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -105,11 +105,11 @@ special within searches (@kbd{C-q}, @kbd{C-w}, @kbd{C-r}, @kbd{C-s},
105@kbd{C-y}, @kbd{M-y}, @kbd{M-r}, @kbd{M-c}, @kbd{M-e}, and some other 105@kbd{C-y}, @kbd{M-y}, @kbd{M-r}, @kbd{M-c}, @kbd{M-e}, and some other
106meta-characters). 106meta-characters).
107 107
108 When you exit the incremental search, it sets the mark where point 108 When you exit the incremental search, it adds the original value of
109@emph{was} before the search. That is convenient for moving back 109point to the mark ring, without activating the mark. You can thus use
110there. In Transient Mark mode, incremental search sets the mark 110@kbd{C-@key{SPC}} to return to where you were before beginning the
111without activating it, and does so only if the mark is not already 111search. @xref{Mark Ring}. It only does this if the mark was not
112active. 112already active.
113 113
114@node Repeat Isearch 114@node Repeat Isearch
115@subsection Repeating Incremental Search 115@subsection Repeating Incremental Search
@@ -961,12 +961,11 @@ there is @kbd{M-%} (@code{query-replace}), which presents each occurrence
961of the pattern and asks you whether to replace it. 961of the pattern and asks you whether to replace it.
962 962
963 The replace commands normally operate on the text from point to the 963 The replace commands normally operate on the text from point to the
964end of the buffer; however, in Transient Mark mode (@pxref{Transient 964end of the buffer. When the mark is active, they operate on the
965Mark}), when the mark is active, they operate on the region. The 965region instead (@pxref{Mark}). The basic replace commands replace one
966basic replace commands replace one string (or regexp) with one 966string (or regexp) with one replacement string. It is possible to
967replacement string. It is possible to perform several replacements in 967perform several replacements in parallel using the command
968parallel using the command @code{expand-region-abbrevs} 968@code{expand-region-abbrevs} (@pxref{Expanding Abbrevs}).
969(@pxref{Expanding Abbrevs}).
970 969
971@menu 970@menu
972* Unconditional Replace:: Replacing all matches for a string. 971* Unconditional Replace:: Replacing all matches for a string.
@@ -991,13 +990,14 @@ point, so if you want to cover the whole buffer you must go to the
991beginning first. All occurrences up to the end of the buffer are 990beginning first. All occurrences up to the end of the buffer are
992replaced; to limit replacement to part of the buffer, narrow to that 991replaced; to limit replacement to part of the buffer, narrow to that
993part of the buffer before doing the replacement (@pxref{Narrowing}). 992part of the buffer before doing the replacement (@pxref{Narrowing}).
994In Transient Mark mode, when the region is active, replacement is 993When the region is active, replacement is limited to the region
995limited to the region (@pxref{Transient Mark}). 994(@pxref{Mark}).
996 995
997 When @code{replace-string} exits, it leaves point at the last 996 When @code{replace-string} exits, it leaves point at the last
998occurrence replaced. It sets the mark to the prior position of point 997occurrence replaced. It adds the prior position of point (where the
999(where the @code{replace-string} command was issued); use @kbd{C-u 998@code{replace-string} command was issued) to the mark ring, without
1000C-@key{SPC}} to move back there. 999activating the mark; use @kbd{C-u C-@key{SPC}} to move back there.
1000@xref{Mark Ring}.
1001 1001
1002 A numeric argument restricts replacement to matches that are surrounded 1002 A numeric argument restricts replacement to matches that are surrounded
1003by word boundaries. The argument's value doesn't matter. 1003by word boundaries. The argument's value doesn't matter.
@@ -1281,8 +1281,7 @@ replacing regexp matches in file names.
1281expression. They all ignore case in matching, if the pattern contains 1281expression. They all ignore case in matching, if the pattern contains
1282no upper-case letters and @code{case-fold-search} is non-@code{nil}. 1282no upper-case letters and @code{case-fold-search} is non-@code{nil}.
1283Aside from @code{occur} and its variants, all operate on the text from 1283Aside from @code{occur} and its variants, all operate on the text from
1284point to the end of the buffer, or on the active region in Transient 1284point to the end of the buffer, or on the region if it is active.
1285Mark mode.
1286 1285
1287@findex list-matching-lines 1286@findex list-matching-lines
1288@findex occur 1287@findex occur
@@ -1332,16 +1331,16 @@ buffer names instead.
1332 1331
1333@item M-x how-many @key{RET} @var{regexp} @key{RET} 1332@item M-x how-many @key{RET} @var{regexp} @key{RET}
1334Print the number of matches for @var{regexp} that exist in the buffer 1333Print the number of matches for @var{regexp} that exist in the buffer
1335after point. In Transient Mark mode, if the region is active, the 1334after point. If the region is active, this operates on the region
1336command operates on the region instead. 1335instead.
1337 1336
1338@item M-x flush-lines @key{RET} @var{regexp} @key{RET} 1337@item M-x flush-lines @key{RET} @var{regexp} @key{RET}
1339This command deletes each line that contains a match for @var{regexp}, 1338This command deletes each line that contains a match for @var{regexp},
1340operating on the text after point; it deletes the current line 1339operating on the text after point; it deletes the current line if it
1341if it contains a match starting after point. In Transient Mark mode, 1340contains a match starting after point. If the region is active, it
1342if the region is active, the command operates on the region instead; 1341operates on the region instead; if a line partially contained in the
1343it deletes a line partially contained in the region if it contains a 1342region contains a match entirely contained in the region, it is
1344match entirely contained in the region. 1343deleted.
1345 1344
1346If a match is split across lines, @code{flush-lines} deletes all those 1345If a match is split across lines, @code{flush-lines} deletes all those
1347lines. It deletes the lines before starting to look for the next 1346lines. It deletes the lines before starting to look for the next
@@ -1349,12 +1348,12 @@ match; hence, it ignores a match starting on the same line at which
1349another match ended. 1348another match ended.
1350 1349
1351@item M-x keep-lines @key{RET} @var{regexp} @key{RET} 1350@item M-x keep-lines @key{RET} @var{regexp} @key{RET}
1352This command deletes each line that @emph{does not} contain a match for 1351This command deletes each line that @emph{does not} contain a match
1353@var{regexp}, operating on the text after point; if point is not at the 1352for @var{regexp}, operating on the text after point; if point is not
1354beginning of a line, it always keeps the current line. In Transient 1353at the beginning of a line, it always keeps the current line. If the
1355Mark mode, if the region is active, the command operates on the region 1354region is active, the command operates on the region instead; it never
1356instead; it never deletes lines that are only partially contained in 1355deletes lines that are only partially contained in the region (a
1357the region (a newline that ends a line counts as part of that line). 1356newline that ends a line counts as part of that line).
1358 1357
1359If a match is split across lines, this command keeps all those lines. 1358If a match is split across lines, this command keeps all those lines.
1360@end table 1359@end table