diff options
| author | Richard M. Stallman | 2002-11-24 19:07:46 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-11-24 19:07:46 +0000 |
| commit | 46b1e9bb80473fe5a3190900ec358ff7a4e9978f (patch) | |
| tree | 5d43b37c5aecef73ba03dd53f5d363ae8eb0d7e6 | |
| parent | 3ae23222ce96c59135f810b564cee84e3340a019 (diff) | |
| download | emacs-46b1e9bb80473fe5a3190900ec358ff7a4e9978f.tar.gz emacs-46b1e9bb80473fe5a3190900ec358ff7a4e9978f.zip | |
(Unconditional Replace): Explain how to replace two strings
each with the other.
| -rw-r--r-- | man/search.texi | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/man/search.texi b/man/search.texi index ea2b461e276..a9d5b5e9ba5 100644 --- a/man/search.texi +++ b/man/search.texi | |||
| @@ -845,6 +845,18 @@ C-@key{SPC}} to move back there. | |||
| 845 | A numeric argument restricts replacement to matches that are surrounded | 845 | A numeric argument restricts replacement to matches that are surrounded |
| 846 | by word boundaries. The argument's value doesn't matter. | 846 | by word boundaries. The argument's value doesn't matter. |
| 847 | 847 | ||
| 848 | What if you want to exchange @samp{x} and @samp{y}: replace every @samp{x} with a @samp{y} and vice versa? You can do it this way: | ||
| 849 | |||
| 850 | @example | ||
| 851 | M-x query-replace @key{RET} x @key{RET} @@TEMP@@ @key{RET} | ||
| 852 | M-x query-replace @key{RET} y @key{RET} x @key{RET} | ||
| 853 | M-x query-replace @key{RET} @@TEMP@@ @key{RET} y @key{RET} | ||
| 854 | @end example | ||
| 855 | |||
| 856 | @noindent | ||
| 857 | This works provided the string @samp{@@TEMP@@} does not appear | ||
| 858 | in your text. | ||
| 859 | |||
| 848 | @node Regexp Replace, Replacement and Case, Unconditional Replace, Replace | 860 | @node Regexp Replace, Replacement and Case, Unconditional Replace, Replace |
| 849 | @subsection Regexp Replacement | 861 | @subsection Regexp Replacement |
| 850 | 862 | ||