unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* case-replace
@ 2011-03-17  2:17 John Yates
  2011-03-17  7:00 ` case-replace Leo
  2011-03-17 20:20 ` case-replace Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: John Yates @ 2011-03-17  2:17 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-18 15:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-17  2:17 case-replace John Yates
2011-03-17  7:00 ` case-replace Leo
2011-03-17 14:54   ` case-replace John Yates
2011-03-18  9:06     ` case-replace Leo
2011-03-17 20:20 ` case-replace Stefan Monnier
2011-03-18 12:42   ` case-replace John Yates
2011-03-18 15:23     ` case-replace Andreas Röhler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).