aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-01-31 18:30:11 +0000
committerRichard M. Stallman2006-01-31 18:30:11 +0000
commit5c5245f71f8699278cd7582ceb2d15a216e17466 (patch)
treec84c32bf898326d0d8296b6517a7f36a37f89a35
parentc48a6229970c6f2b4308fe8624bf169e938bf816 (diff)
downloademacs-5c5245f71f8699278cd7582ceb2d15a216e17466.tar.gz
emacs-5c5245f71f8699278cd7582ceb2d15a216e17466.zip
Minor clarifications.
(Isearch Scroll): Simplify. (Other Repeating Search): Document multi-occur-in-matching-buffers.
-rw-r--r--man/search.texi98
1 files changed, 48 insertions, 50 deletions
diff --git a/man/search.texi b/man/search.texi
index 3c9e439e76d..b1593559c85 100644
--- a/man/search.texi
+++ b/man/search.texi
@@ -41,7 +41,6 @@ found. When you have typed enough characters to identify the place you
41want, you can stop. Depending on what you plan to do next, you may or 41want, you can stop. Depending on what you plan to do next, you may or
42may not need to terminate the search explicitly with @key{RET}. 42may not need to terminate the search explicitly with @key{RET}.
43 43
44@c WideCommands
45@table @kbd 44@table @kbd
46@item C-s 45@item C-s
47Incremental search forward (@code{isearch-forward}). 46Incremental search forward (@code{isearch-forward}).
@@ -73,9 +72,9 @@ from the keyboard, and moves point past the next occurrence of those
73characters. If you type @kbd{C-s} and then @kbd{F}, that puts the 72characters. If you type @kbd{C-s} and then @kbd{F}, that puts the
74cursor after the first @samp{F} (the first following the starting point, since 73cursor after the first @samp{F} (the first following the starting point, since
75this is a forward search). Then if you type an @kbd{O}, you will see 74this is a forward search). Then if you type an @kbd{O}, you will see
76the cursor move just after the first @samp{FO} (the @samp{F} in that 75the cursor move to just after the first @samp{FO} (the @samp{F} in that
77@samp{FO} may or may not be the first @samp{F}). After another 76@samp{FO} may or may not be the first @samp{F}). After another
78@kbd{O}, the cursor moves after the first @samp{FOO} after the place 77@kbd{O}, the cursor moves to just after the first @samp{FOO} after the place
79where you started the search. At each step, the buffer text that 78where you started the search. At each step, the buffer text that
80matches the search string is highlighted, if the terminal can do that; 79matches the search string is highlighted, if the terminal can do that;
81the current search string is always displayed in the echo area. 80the current search string is always displayed in the echo area.
@@ -135,19 +134,20 @@ string in the minibuffer without replacing it with items from the
135search ring, type @kbd{M-e}. Type @kbd{C-s} or @kbd{C-r} 134search ring, type @kbd{M-e}. Type @kbd{C-s} or @kbd{C-r}
136to terminate editing the string and search for it. 135to terminate editing the string and search for it.
137 136
138 You can change to searching backwards with @kbd{C-r}. If a search fails 137 You can change to searching backwards with @kbd{C-r}. For instance,
139because the place you started was too late in the file, you should do this. 138if you are searching forward but you realize you were looking for
140Repeated @kbd{C-r} keeps looking for more occurrences backwards. A 139something above the starting point, you can do this. Repeated
141@kbd{C-s} starts going forwards again. @kbd{C-r} in a search can be canceled 140@kbd{C-r} keeps looking for more occurrences backwards. A @kbd{C-s}
141starts going forwards again. @kbd{C-r} in a search can be canceled
142with @key{DEL}. 142with @key{DEL}.
143 143
144@kindex C-r 144@kindex C-r
145@findex isearch-backward 145@findex isearch-backward
146 If you know initially that you want to search backwards, you can use 146 If you know initially that you want to search backwards, you can use
147@kbd{C-r} instead of @kbd{C-s} to start the search, because @kbd{C-r} as 147@kbd{C-r} instead of @kbd{C-s} to start the search, because @kbd{C-r}
148a key runs a command (@code{isearch-backward}) to search backward. A 148as a key runs a command (@code{isearch-backward}) to search backward.
149backward search finds matches that are entirely before the starting 149A backward search finds matches that end before the starting point,
150point, just as a forward search finds matches that begin after it. 150just as a forward search finds matches that begin after it.
151 151
152@node Error in Isearch 152@node Error in Isearch
153@subsection Errors in Incremental Search 153@subsection Errors in Incremental Search
@@ -281,50 +281,46 @@ If you don't like this feature, you can turn it off by setting
281@cindex faces for highlighting search matches 281@cindex faces for highlighting search matches
282 You can control how this highlighting looks by customizing the faces 282 You can control how this highlighting looks by customizing the faces
283@code{isearch} (used for the current match) and @code{lazy-highlight} 283@code{isearch} (used for the current match) and @code{lazy-highlight}
284(for all the other matches). The latter is also used for other matches 284(for all the other matches).
285inside @code{query-replace}.
286 285
287@node Isearch Scroll 286@node Isearch Scroll
288@subsection Scrolling During Incremental Search 287@subsection Scrolling During Incremental Search
289 288
290 Vertical scrolling during incremental search can be enabled by 289 You can enable the use of vertical scrolling during incremental
291setting the customizable variable @code{isearch-allow-scroll} to a 290search (without exiting the search) by setting the customizable
292non-@code{nil} value. 291variable @code{isearch-allow-scroll} to a non-@code{nil} value. This
293 292applies to using the vertical scroll-bar and to certain keyboard
294 You can then use the vertical scroll-bar or certain keyboard
295commands such as @kbd{@key{PRIOR}} (@code{scroll-down}), 293commands such as @kbd{@key{PRIOR}} (@code{scroll-down}),
296@kbd{@key{NEXT}} (@code{scroll-up}) and @kbd{C-l} (@code{recenter}) 294@kbd{@key{NEXT}} (@code{scroll-up}) and @kbd{C-l} (@code{recenter}).
297within the search, thus letting you see more of the text near the 295You must run these commands via their key sequences to stay in the
298current match. You must run these commands via their key sequences to 296search---typing @kbd{M-x} will terminate the search. You can give
299stay in the search---typing M-x @var{command-name} will always 297prefix arguments to these commands in the usual way.
300terminate a search.
301 298
302 You can give prefix arguments to these commands in the usual way. 299 This feature won't let you scroll the current match out of visibility,
303The current match cannot be scrolled out of the window---this is 300however.
304intentional.
305 301
306 Several other commands, such as @kbd{C-x 2} 302 The feature also affects some other commands, such as @kbd{C-x 2}
307(@code{split-window-vertically}) and @kbd{C-x ^} 303(@code{split-window-vertically}) and @kbd{C-x ^}
308(@code{enlarge-window}) which don't scroll the window, are 304(@code{enlarge-window}) which don't exactly scroll but do affect where
309nevertheless made available under this rubric, since they are likewise 305the text appears on the screen. In general, it applies to any command
310handy during a search. 306whose name has a non-@code{nil} @code{isearch-scroll} property. So you
307can control which commands are affected by changing these properties.
311 308
312 You can make other commands usable within an incremental search by 309 For example, to make @kbd{C-h l} usable within an incremental search
313giving the command a non-@code{nil} @code{isearch-scroll} property.
314For example, to make @kbd{C-h l} usable within an incremental search
315in all future Emacs sessions, use @kbd{C-h c} to find what command it 310in all future Emacs sessions, use @kbd{C-h c} to find what command it
316runs. (You type @kbd{C-h c C-h l}; it says @code{view-lossage}.) Then 311runs. (You type @kbd{C-h c C-h l}; it says @code{view-lossage}.)
317you can put the following line in your @file{.emacs} file (@pxref{Init File}): 312Then you can put the following line in your @file{.emacs} file
313(@pxref{Init File}):
318 314
319@example 315@example
320(put 'view-lossage 'isearch-scroll t) 316(put 'view-lossage 'isearch-scroll t)
321@end example 317@end example
322 318
323@noindent 319@noindent
324This works for commands that don't permanently change point, the 320This feature can be applied to any command that doesn't permanently
325buffer contents, the match data, the current buffer, or the selected 321change point, the buffer contents, the match data, the current buffer,
326window and frame. The command must not delete the current window and 322or the selected window and frame. The command must not itself attempt
327must not itself attempt an incremental search. 323an incremental search.
328 324
329@node Slow Isearch 325@node Slow Isearch
330@subsection Slow Terminal Incremental Search 326@subsection Slow Terminal Incremental Search
@@ -387,7 +383,7 @@ which specifies a word search.
387commands @code{search-forward} and @code{search-backward}. These 383commands @code{search-forward} and @code{search-backward}. These
388commands may be bound to keys in the usual manner. The feature that you 384commands may be bound to keys in the usual manner. The feature that you
389can get to them via the incremental search commands exists for 385can get to them via the incremental search commands exists for
390historical reasons, and to avoid the need to find key sequences 386historical reasons, and to avoid the need to find separate key sequences
391for them. 387for them.
392 388
393@node Word Search 389@node Word Search
@@ -427,7 +423,7 @@ by constructing a regular expression and searching for that; see
427@code{word-search-forward} and @code{word-search-backward}. These 423@code{word-search-forward} and @code{word-search-backward}. These
428commands may be bound to keys in the usual manner. They are available 424commands may be bound to keys in the usual manner. They are available
429via the incremental search commands both for historical reasons and 425via the incremental search commands both for historical reasons and
430to avoid the need to find suitable key sequences for them. 426to avoid the need to find separate key sequences for them.
431 427
432@node Regexp Search 428@node Regexp Search
433@section Regular Expression Search 429@section Regular Expression Search
@@ -468,10 +464,10 @@ defaults. They also have separate search rings that you can access with
468 If you type @key{SPC} in incremental regexp search, it matches any 464 If you type @key{SPC} in incremental regexp search, it matches any
469sequence of whitespace characters, including newlines. If you want to 465sequence of whitespace characters, including newlines. If you want to
470match just a space, type @kbd{C-q @key{SPC}}. You can control what a 466match just a space, type @kbd{C-q @key{SPC}}. You can control what a
471bare spece matches by setting the variable 467bare space matches by setting the variable
472@code{search-whitespace-regexp} to the desired regexp. 468@code{search-whitespace-regexp} to the desired regexp.
473 469
474 Note that adding characters to the regexp in an incremental regexp 470 In some cases, adding characters to the regexp in an incremental regexp
475search can make the cursor move back and start again. For example, if 471search can make the cursor move back and start again. For example, if
476you have searched for @samp{foo} and you add @samp{\|bar}, the cursor 472you have searched for @samp{foo} and you add @samp{\|bar}, the cursor
477backs up in case the first @samp{bar} precedes the first @samp{foo}. 473backs up in case the first @samp{bar} precedes the first @samp{foo}.
@@ -932,7 +928,7 @@ of the pattern and asks you whether to replace it.
932 The replace commands normally operate on the text from point to the 928 The replace commands normally operate on the text from point to the
933end of the buffer; however, in Transient Mark mode (@pxref{Transient 929end of the buffer; however, in Transient Mark mode (@pxref{Transient
934Mark}), when the mark is active, they operate on the region. The 930Mark}), when the mark is active, they operate on the region. The
935replace commands all replace one string (or regexp) with one 931basic replace commands replace one string (or regexp) with one
936replacement string. It is possible to perform several replacements in 932replacement string. It is possible to perform several replacements in
937parallel using the command @code{expand-region-abbrevs} 933parallel using the command @code{expand-region-abbrevs}
938(@pxref{Expanding Abbrevs}). 934(@pxref{Expanding Abbrevs}).
@@ -1246,7 +1242,7 @@ Mark mode.
1246@findex list-matching-lines 1242@findex list-matching-lines
1247@findex occur 1243@findex occur
1248@findex multi-occur 1244@findex multi-occur
1249@findex multi-occur-by-filename-regexp 1245@findex multi-occur-in-matching-buffers
1250@findex how-many 1246@findex how-many
1251@findex delete-non-matching-lines 1247@findex delete-non-matching-lines
1252@findex delete-matching-lines 1248@findex delete-matching-lines
@@ -1273,19 +1269,21 @@ searched and moves point to the original of the chosen occurrence.
1273@kbd{o} and @kbd{C-o} display the match in another window; @kbd{C-o} 1269@kbd{o} and @kbd{C-o} display the match in another window; @kbd{C-o}
1274does not select it. 1270does not select it.
1275 1271
1276Occur mode supports the @code{next-error} functionality described in 1272After using @kbd{M-x occur}, you can use @code{next-error} to visit
1277@ref{Compilation Mode}. 1273the occurrences found, one by one. @ref{Compilation Mode}.
1278 1274
1279@item M-x list-matching-lines 1275@item M-x list-matching-lines
1280Synonym for @kbd{M-x occur}. 1276Synonym for @kbd{M-x occur}.
1281 1277
1282@item M-x multi-occur @key{RET} @var{buffers} @key{RET} @var{regexp} @key{RET} 1278@item M-x multi-occur @key{RET} @var{buffers} @key{RET} @var{regexp} @key{RET}
1283This function is just like @code{occur}, except it is able to search 1279This function is just like @code{occur}, except it is able to search
1284through multiple buffers. 1280through multiple buffers. It asks you to specify the buffer names one by one.
1285 1281
1286@item M-x multi-occur-by-filename-regexp @key{RET} @var{bufregexp} @key{RET} @var{regexp} @key{RET} 1282@item M-x multi-occur-in-matching-buffers @key{RET} @var{bufregexp} @key{RET} @var{regexp} @key{RET}
1287This function is similar to @code{multi-occur}, except the buffers to 1283This function is similar to @code{multi-occur}, except the buffers to
1288search are specified by a regexp on their filename. 1284search are specified by a regular expression that matches visited
1285filenames. With a prefix argument, it uses the regular expression to match
1286buffer names instead.
1289 1287
1290@item M-x how-many @key{RET} @var{regexp} @key{RET} 1288@item M-x how-many @key{RET} @var{regexp} @key{RET}
1291Print the number of matches for @var{regexp} that exist in the buffer 1289Print the number of matches for @var{regexp} that exist in the buffer