[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
case-replace
From: |
John Yates |
Subject: |
case-replace |
Date: |
Wed, 16 Mar 2011 22:17:48 -0400 |
Here is a description of case-replace as it behaves today:
| Replacement transfers the case
| pattern of the old text to the new text, if `case-replace' and
| `case-fold-search' are non-nil and FROM-STRING has no uppercase
| letters. (Transferring the case pattern means that if the old text
| matched is all caps, or capitalized, then its replacement is upcased
| or capitalized.)
Thus we give a request to replace 'ab' by 'xyz' we get
ab -> xyz
Ab -> Xyz
AB -> XYZ
aB -> xyz <<<<
These rules make sense when FROM and TO differ in length.
I often find myself replacing a FROM string with a TO of identical
length. In such a case I would really appreciate it if case were
preserved at each character position. E.g. replacing 'ab' by 'xy'
would give me:
ab -> xy
Ab -> Xy
AB -> XY
aB -> xY <<<<
/john
- case-replace,
John Yates <=