2158 |
|
|
2159 |
DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, |
DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, |
2160 |
doc: /* Replace text matched by last search with NEWTEXT. |
doc: /* Replace text matched by last search with NEWTEXT. |
2161 |
|
Leave point at the end of the replacement text. |
2162 |
|
|
2163 |
If second arg FIXEDCASE is non-nil, do not alter case of replacement text. |
If second arg FIXEDCASE is non-nil, do not alter case of replacement text. |
2164 |
Otherwise maybe capitalize the whole text, or maybe just word initials, |
Otherwise maybe capitalize the whole text, or maybe just word initials, |
2165 |
based on the replaced text. |
based on the replaced text. |
2166 |
If the replaced text has only capital letters |
If the replaced text has only capital letters |
2167 |
and has at least one multiletter word, convert NEWTEXT to all caps. |
and has at least one multiletter word, convert NEWTEXT to all caps. |
2168 |
If the replaced text has at least one word starting with a capital letter, |
Otherwise if all words are capitalized in the replaced text, |
2169 |
then capitalize each word in NEWTEXT. |
capitalize each word in NEWTEXT. |
2170 |
|
|
2171 |
If third arg LITERAL is non-nil, insert NEWTEXT literally. |
If third arg LITERAL is non-nil, insert NEWTEXT literally. |
2172 |
Otherwise treat `\\' as special: |
Otherwise treat `\\' as special: |
2174 |
`\\N' means substitute what matched the Nth `\\(...\\)'. |
`\\N' means substitute what matched the Nth `\\(...\\)'. |
2175 |
If Nth parens didn't match, substitute nothing. |
If Nth parens didn't match, substitute nothing. |
2176 |
`\\\\' means insert one `\\'. |
`\\\\' means insert one `\\'. |
2177 |
|
Case conversion does not apply to these substitutions. |
2178 |
|
|
2179 |
FIXEDCASE and LITERAL are optional arguments. |
FIXEDCASE and LITERAL are optional arguments. |
|
Leaves point at end of replacement text. |
|
2180 |
|
|
2181 |
The optional fourth argument STRING can be a string to modify. |
The optional fourth argument STRING can be a string to modify. |
2182 |
This is meaningful when the previous match was done against STRING, |
This is meaningful when the previous match was done against STRING, |