168 |
</p> |
</p> |
169 |
<p> After you exit a search, you can search for the same string again by |
<p> After you exit a search, you can search for the same string again by |
170 |
typing just <kbd>C-s C-s</kbd>: the first <kbd>C-s</kbd> is the key that invokes |
typing just <kbd>C-s C-s</kbd>: the first <kbd>C-s</kbd> is the key that invokes |
171 |
incremental search, and the second <kbd>C-s</kbd> means "search again". |
incremental search, and the second <kbd>C-s</kbd> means “search again”. |
172 |
</p> |
</p> |
173 |
<p> If the specified string is not found at all, the echo area displays |
<p> If the specified string is not found at all, the echo area displays |
174 |
the text <samp>`Failing I-Search'</samp>. The cursor is after the place where |
the text <samp>`Failing I-Search'</samp>. The cursor is after the place where |
177 |
<samp>`FOO'</samp> in <samp>`FOOL'</samp>. At this point there are several things you |
<samp>`FOO'</samp> in <samp>`FOOL'</samp>. At this point there are several things you |
178 |
can do. If you mistyped the search string, correct it. If you like the |
can do. If you mistyped the search string, correct it. If you like the |
179 |
place you have found, you can type <kbd>RET</kbd> or some other Emacs command |
place you have found, you can type <kbd>RET</kbd> or some other Emacs command |
180 |
to "accept what the search offered". Or you can type <kbd>C-g</kbd>, which |
to “accept what the search offered”. Or you can type <kbd>C-g</kbd>, which |
181 |
removes from the search string the characters that could not be found |
removes from the search string the characters that could not be found |
182 |
(the <samp>`T'</samp> in <samp>`FOOT'</samp>), leaving those that were found (the |
(the <samp>`T'</samp> in <samp>`FOOT'</samp>), leaving those that were found (the |
183 |
<samp>`FOO'</samp> in <samp>`FOOT'</samp>). A second <kbd>C-g</kbd> at that point cancels |
<samp>`FOO'</samp> in <samp>`FOOT'</samp>). A second <kbd>C-g</kbd> at that point cancels |
191 |
prompt once this has happened. |
prompt once this has happened. |
192 |
</p> |
</p> |
193 |
<a name="IDX411"></a> |
<a name="IDX411"></a> |
194 |
<p> The <kbd>C-g</kbd> "quit" character does special things during searches; |
<p> The <kbd>C-g</kbd> “quit” character does special things during searches; |
195 |
just what it does depends on the status of the search. If the search has |
just what it does depends on the status of the search. If the search has |
196 |
found what you specified and is waiting for input, <kbd>C-g</kbd> cancels the |
found what you specified and is waiting for input, <kbd>C-g</kbd> cancels the |
197 |
entire search. The cursor moves back to where you started the search. If |
entire search. The cursor moves back to where you started the search. If |
198 |
<kbd>C-g</kbd> is typed when there are characters in the search string that have |
<kbd>C-g</kbd> is typed when there are characters in the search string that have |
199 |
not been found--because Emacs is still searching for them, or because it |
not been found—because Emacs is still searching for them, or because it |
200 |
has failed to find them--then the search string characters which have not |
has failed to find them—then the search string characters which have not |
201 |
been found are discarded from the search string. The |
been found are discarded from the search string. The |
202 |
search is now successful and waiting for more input, so a second <kbd>C-g</kbd> |
search is now successful and waiting for more input, so a second <kbd>C-g</kbd> |
203 |
cancels the entire search. |
cancels the entire search. |
240 |
<p> You can change any of the special characters in incremental search via |
<p> You can change any of the special characters in incremental search via |
241 |
the normal keybinding mechanism: simply add a binding to the |
the normal keybinding mechanism: simply add a binding to the |
242 |
<code>isearch-mode-map</code>. For example, to make the character |
<code>isearch-mode-map</code>. For example, to make the character |
243 |
<kbd>C-b</kbd> mean "search backwards" while in isearch-mode, do this: |
<kbd>C-b</kbd> mean “search backwards” while in isearch-mode, do this: |
244 |
</p> |
</p> |
245 |
<table><tr><td> </td><td><pre class="example">(define-key isearch-mode-map "\C-b" 'isearch-repeat-backward) |
<table><tr><td> </td><td><pre class="example">(define-key isearch-mode-map "\C-b" 'isearch-repeat-backward) |
246 |
</pre></td></tr></table> |
</pre></td></tr></table> |
508 |
<p> The XEmacs regular expression syntax most closely resembles that of |
<p> The XEmacs regular expression syntax most closely resembles that of |
509 |
<cite>ed</cite>, or <cite>grep</cite>, the GNU versions of which all utilize the GNU |
<cite>ed</cite>, or <cite>grep</cite>, the GNU versions of which all utilize the GNU |
510 |
<cite>regex</cite> library. XEmacs' version of <cite>regex</cite> has recently been |
<cite>regex</cite> library. XEmacs' version of <cite>regex</cite> has recently been |
511 |
extended with some Perl-like capabilities, described in the next |
extended with some Perl–like capabilities, described in the next |
512 |
section. |
section. |
513 |
</p> |
</p> |
514 |
<p> In XEmacs, you can search for the next match for a regexp either |
<p> In XEmacs, you can search for the next match for a regexp either |
854 |
substring to be recorded for future reference. |
substring to be recorded for future reference. |
855 |
</p> |
</p> |
856 |
<p>This is useful when you need a lot of grouping <samp>`\( … \)'</samp> |
<p>This is useful when you need a lot of grouping <samp>`\( … \)'</samp> |
857 |
constructs, but only want to remember one or two - or if you have |
constructs, but only want to remember one or two – or if you have |
858 |
more than nine groupings and need to use backreferences to refer to |
more than nine groupings and need to use backreferences to refer to |
859 |
the groupings at the end. |
the groupings at the end. |
860 |
</p> |
</p> |
895 |
</p></dd> |
</p></dd> |
896 |
</dl> |
</dl> |
897 |
|
|
898 |
<p> The following regular expression constructs match the empty string--that is, |
<p> The following regular expression constructs match the empty string—that is, |
899 |
they don't use up any characters--but whether they match depends on the |
they don't use up any characters—but whether they match depends on the |
900 |
context. |
context. |
901 |
</p> |
</p> |
902 |
<dl compact="compact"> |
<dl compact="compact"> |