diff options
| author | Richard M. Stallman | 2002-05-04 06:33:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-05-04 06:33:47 +0000 |
| commit | 2037b26301a67531ebed5f5bb56e7dbf95aaeb51 (patch) | |
| tree | f1a8ec8f9f3346976bfd7c4dcbde291daa1bb8df | |
| parent | 8f21d64ed153342c04bf22fc37bc8056d2c563eb (diff) | |
| download | emacs-2037b26301a67531ebed5f5bb56e7dbf95aaeb51.tar.gz emacs-2037b26301a67531ebed5f5bb56e7dbf95aaeb51.zip | |
Clarify how replace-match does case conversion.
| -rw-r--r-- | lispref/searching.texi | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lispref/searching.texi b/lispref/searching.texi index 1e140aa641a..6918aa32f1a 100644 --- a/lispref/searching.texi +++ b/lispref/searching.texi | |||
| @@ -1209,15 +1209,15 @@ If you did the search in a string, pass the same string as @var{string}. | |||
| 1209 | Then @code{replace-match} does the replacement by constructing and | 1209 | Then @code{replace-match} does the replacement by constructing and |
| 1210 | returning a new string. | 1210 | returning a new string. |
| 1211 | 1211 | ||
| 1212 | If @var{fixedcase} is non-@code{nil}, then the case of the replacement | 1212 | If @var{fixedcase} is non-@code{nil}, then @code{replace-match} uses |
| 1213 | text is not changed; otherwise, the replacement text is converted to a | 1213 | the replacement text without case conversion; otherwise, it converts |
| 1214 | different case depending upon the capitalization of the text to be | 1214 | the replacement text depending upon the capitalization of the text to |
| 1215 | replaced. If the original text is all upper case, the replacement text | 1215 | be replaced. If the original text is all upper case, this converts |
| 1216 | is converted to upper case. If the first word of the original text is | 1216 | the replacement text to upper case. If all words of the original text |
| 1217 | capitalized, then the first word of the replacement text is capitalized. | 1217 | are capitalized, this capitalizes all the words of the replacement |
| 1218 | If the original text contains just one word, and that word is a capital | 1218 | text. If all the words are one-letter and they are all upper case, |
| 1219 | letter, @code{replace-match} considers this a capitalized first word | 1219 | they are treated as capitalized words rather than all-upper-case |
| 1220 | rather than all upper case. | 1220 | words. |
| 1221 | 1221 | ||
| 1222 | If @var{literal} is non-@code{nil}, then @var{replacement} is inserted | 1222 | If @var{literal} is non-@code{nil}, then @var{replacement} is inserted |
| 1223 | exactly as it is, the only alterations being case changes as needed. | 1223 | exactly as it is, the only alterations being case changes as needed. |
| @@ -1241,6 +1241,9 @@ Subexpressions are those expressions grouped inside @samp{\(@dots{}\)}. | |||
| 1241 | @samp{\\} stands for a single @samp{\} in the replacement text. | 1241 | @samp{\\} stands for a single @samp{\} in the replacement text. |
| 1242 | @end table | 1242 | @end table |
| 1243 | 1243 | ||
| 1244 | These substitutions occur after case conversion, if any, | ||
| 1245 | so the strings they substitute are never case-converted. | ||
| 1246 | |||
| 1244 | If @var{subexp} is non-@code{nil}, that says to replace just | 1247 | If @var{subexp} is non-@code{nil}, that says to replace just |
| 1245 | subexpression number @var{subexp} of the regexp that was matched, not | 1248 | subexpression number @var{subexp} of the regexp that was matched, not |
| 1246 | the entire match. For example, after matching @samp{foo \(ba*r\)}, | 1249 | the entire match. For example, after matching @samp{foo \(ba*r\)}, |