diff options
| -rw-r--r-- | doc/emacs/search.texi | 61 |
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 |
| 106 | meta-characters). | 106 | meta-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 | 109 | point to the mark ring, without activating the mark. You can thus use |
| 110 | there. In Transient Mark mode, incremental search sets the mark | 110 | @kbd{C-@key{SPC}} to return to where you were before beginning the |
| 111 | without activating it, and does so only if the mark is not already | 111 | search. @xref{Mark Ring}. It only does this if the mark was not |
| 112 | active. | 112 | already 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 | |||
| 961 | of the pattern and asks you whether to replace it. | 961 | of 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 |
| 964 | end of the buffer; however, in Transient Mark mode (@pxref{Transient | 964 | end of the buffer. When the mark is active, they operate on the |
| 965 | Mark}), when the mark is active, they operate on the region. The | 965 | region instead (@pxref{Mark}). The basic replace commands replace one |
| 966 | basic replace commands replace one string (or regexp) with one | 966 | string (or regexp) with one replacement string. It is possible to |
| 967 | replacement string. It is possible to perform several replacements in | 967 | perform several replacements in parallel using the command |
| 968 | parallel 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 | |||
| 991 | beginning first. All occurrences up to the end of the buffer are | 990 | beginning first. All occurrences up to the end of the buffer are |
| 992 | replaced; to limit replacement to part of the buffer, narrow to that | 991 | replaced; to limit replacement to part of the buffer, narrow to that |
| 993 | part of the buffer before doing the replacement (@pxref{Narrowing}). | 992 | part of the buffer before doing the replacement (@pxref{Narrowing}). |
| 994 | In Transient Mark mode, when the region is active, replacement is | 993 | When the region is active, replacement is limited to the region |
| 995 | limited 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 |
| 998 | occurrence replaced. It sets the mark to the prior position of point | 997 | occurrence 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 |
| 1000 | C-@key{SPC}} to move back there. | 999 | activating 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 |
| 1003 | by word boundaries. The argument's value doesn't matter. | 1003 | by word boundaries. The argument's value doesn't matter. |
| @@ -1281,8 +1281,7 @@ replacing regexp matches in file names. | |||
| 1281 | expression. They all ignore case in matching, if the pattern contains | 1281 | expression. They all ignore case in matching, if the pattern contains |
| 1282 | no upper-case letters and @code{case-fold-search} is non-@code{nil}. | 1282 | no upper-case letters and @code{case-fold-search} is non-@code{nil}. |
| 1283 | Aside from @code{occur} and its variants, all operate on the text from | 1283 | Aside from @code{occur} and its variants, all operate on the text from |
| 1284 | point to the end of the buffer, or on the active region in Transient | 1284 | point to the end of the buffer, or on the region if it is active. |
| 1285 | Mark 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} |
| 1334 | Print the number of matches for @var{regexp} that exist in the buffer | 1333 | Print the number of matches for @var{regexp} that exist in the buffer |
| 1335 | after point. In Transient Mark mode, if the region is active, the | 1334 | after point. If the region is active, this operates on the region |
| 1336 | command operates on the region instead. | 1335 | instead. |
| 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} |
| 1339 | This command deletes each line that contains a match for @var{regexp}, | 1338 | This command deletes each line that contains a match for @var{regexp}, |
| 1340 | operating on the text after point; it deletes the current line | 1339 | operating on the text after point; it deletes the current line if it |
| 1341 | if it contains a match starting after point. In Transient Mark mode, | 1340 | contains a match starting after point. If the region is active, it |
| 1342 | if the region is active, the command operates on the region instead; | 1341 | operates on the region instead; if a line partially contained in the |
| 1343 | it deletes a line partially contained in the region if it contains a | 1342 | region contains a match entirely contained in the region, it is |
| 1344 | match entirely contained in the region. | 1343 | deleted. |
| 1345 | 1344 | ||
| 1346 | If a match is split across lines, @code{flush-lines} deletes all those | 1345 | If a match is split across lines, @code{flush-lines} deletes all those |
| 1347 | lines. It deletes the lines before starting to look for the next | 1346 | lines. 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 | |||
| 1349 | another match ended. | 1348 | another 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} |
| 1352 | This command deletes each line that @emph{does not} contain a match for | 1351 | This 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 | 1352 | for @var{regexp}, operating on the text after point; if point is not |
| 1354 | beginning of a line, it always keeps the current line. In Transient | 1353 | at the beginning of a line, it always keeps the current line. If the |
| 1355 | Mark mode, if the region is active, the command operates on the region | 1354 | region is active, the command operates on the region instead; it never |
| 1356 | instead; it never deletes lines that are only partially contained in | 1355 | deletes lines that are only partially contained in the region (a |
| 1357 | the region (a newline that ends a line counts as part of that line). | 1356 | newline that ends a line counts as part of that line). |
| 1358 | 1357 | ||
| 1359 | If a match is split across lines, this command keeps all those lines. | 1358 | If a match is split across lines, this command keeps all those lines. |
| 1360 | @end table | 1359 | @end table |