Mercurial > emacs
comparison man/search.texi @ 56778:aeee9d21eb4a
(Regexps): Correct cryptic @ref.
(Configuring Scrolling): Correct invalid @xref.
(Regexp Replace): Standardize reference to hardcopy Elisp Manual in @pxref.
author | Luc Teirlinck <teirllm@auburn.edu> |
---|---|
date | Tue, 24 Aug 2004 03:43:17 +0000 |
parents | 1e634b993162 |
children | cd2d19602e50 d8411455de48 |
comparison
equal
deleted
inserted
replaced
56777:332e641fe2b1 | 56778:aeee9d21eb4a |
---|---|
432 @cindex syntax of regexps | 432 @cindex syntax of regexps |
433 | 433 |
434 This manual describes regular expression features that users | 434 This manual describes regular expression features that users |
435 typically want to use. There are additional features that are | 435 typically want to use. There are additional features that are |
436 mainly used in Lisp programs; see @ref{Regular Expressions,,, | 436 mainly used in Lisp programs; see @ref{Regular Expressions,,, |
437 elisp, the same manual}. | 437 elisp, The Emacs Lisp Reference Manual}. |
438 | 438 |
439 Regular expressions have a syntax in which a few characters are | 439 Regular expressions have a syntax in which a few characters are |
440 special constructs and the rest are @dfn{ordinary}. An ordinary | 440 special constructs and the rest are @dfn{ordinary}. An ordinary |
441 character is a simple regular expression which matches that same | 441 character is a simple regular expression which matches that same |
442 character and nothing else. The special characters are @samp{$}, | 442 character and nothing else. The special characters are @samp{$}, |
919 @item | 919 @item |
920 The buffer contents. | 920 The buffer contents. |
921 @item | 921 @item |
922 The selected window and selected frame. | 922 The selected window and selected frame. |
923 @item | 923 @item |
924 The current match-data @xref{Match Data,,,elisp}. | 924 The current match-data. @xref{Match Data,,, elisp, The Emacs Lisp |
925 Reference Manual}. | |
925 @end enumerate | 926 @end enumerate |
926 | 927 |
927 Additionally, the command must not delete the current window and must | 928 Additionally, the command must not delete the current window and must |
928 not itself attempt an incremental search. It may, however, change the | 929 not itself attempt an incremental search. It may, however, change the |
929 window's size, or create or delete other windows and frames. | 930 window's size, or create or delete other windows and frames. |
930 | 931 |
931 Note that an attempt by a command to scroll the text | 932 Note that an attempt by a command to scroll the text |
932 @emph{horizontally} won't work, although it will do no harm---any such | 933 @emph{horizontally} won't work, although it will do no harm---any such |
933 scrolling will be overriden and nullified by the display code. | 934 scrolling will be overridden and nullified by the display code. |
934 | 935 |
935 @node Replace, Other Repeating Search, Configuring Scrolling, Search | 936 @node Replace, Other Repeating Search, Configuring Scrolling, Search |
936 @section Replacement Commands | 937 @section Replacement Commands |
937 @cindex replacement | 938 @cindex replacement |
938 @cindex search-and-replace commands | 939 @cindex search-and-replace commands |
1061 M-x replace-regexp @key{RET} \(x\)\|y @key{RET} | 1062 M-x replace-regexp @key{RET} \(x\)\|y @key{RET} |
1062 \,(if \1 "y" "x") @key{RET} | 1063 \,(if \1 "y" "x") @key{RET} |
1063 @end example | 1064 @end example |
1064 | 1065 |
1065 For computing replacement strings for @samp{\,}, the @code{format} | 1066 For computing replacement strings for @samp{\,}, the @code{format} |
1066 function is often useful (@pxref{Formatting Strings,,,elisp, GNU Emacs | 1067 function is often useful (@pxref{Formatting Strings,,, elisp, The Emacs |
1067 Lisp Reference Manual}). For example, to add consecutively numbered | 1068 Lisp Reference Manual}). For example, to add consecutively numbered |
1068 strings like @samp{ABC00042} to columns 73 @w{to 80} (unless they are | 1069 strings like @samp{ABC00042} to columns 73 @w{to 80} (unless they are |
1069 already occupied), you can use | 1070 already occupied), you can use |
1070 | 1071 |
1071 @example | 1072 @example |
1082 M-x replace-regexp @key{RET} \footnote@{ @key{RET} | 1083 M-x replace-regexp @key{RET} \footnote@{ @key{RET} |
1083 \&\\label@{fn:\#\?@} @key{RET} | 1084 \&\\label@{fn:\#\?@} @key{RET} |
1084 @end example | 1085 @end example |
1085 | 1086 |
1086 @noindent | 1087 @noindent |
1087 will add labels starting with @samp{\label@{fn:0@}} to occurences of | 1088 will add labels starting with @samp{\label@{fn:0@}} to occurrences of |
1088 @samp{\footnote@{}, but letting you edit each replacement before | 1089 @samp{\footnote@{}, but letting you edit each replacement before |
1089 performing it. To number the labels starting at 1, use @samp{\,(1+ | 1090 performing it. To number the labels starting at 1, use @samp{\,(1+ |
1090 \#)} instead of @samp{\#}. | 1091 \#)} instead of @samp{\#}. |
1091 | 1092 |
1092 @node Replacement and Case, Query Replace, Regexp Replace, Replace | 1093 @node Replacement and Case, Query Replace, Regexp Replace, Replace |