From: Andreas Schwab <schwab@suse.de>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: case conversion by replace-match
Date: Fri, 16 May 2003 23:07:40 +0200 [thread overview]
Message-ID: <jehe7u7g83.fsf@sykes.suse.de> (raw)
In-Reply-To: <16068.62114.573866.744811@tfkp07.physik.uni-erlangen.de> (Roland Winkler's message of "Fri, 16 May 2003 16:16:02 +0200")
Roland Winkler <roland.winkler@physik.uni-erlangen.de> writes:
|> Start a fresh emacs --no-init-file
|>
|> define the following function
|>
|> (defun foo ()
|> (interactive)
|> (let (case-fold-search)
|> (while (search-forward "=FC" nil t)
|> (replace-match (string 252) nil t))))
|>
|> `(string 252)' gives a lowercase umlaut-u (iso-latin-1)
|>
|> However, when foo is run in a buffer containing the string "=FC",
|> this string will be replaced with an uppercase umlaut-U.
Exactly as documented. If you don't want this, pass a non-nil second
argument to replace-match:
If second arg FIXEDCASE is non-nil, do not alter case of replacement text.
Otherwise maybe capitalize the whole text, or maybe just word initials,
based on the replaced text.
If the replaced text has only capital letters
and has at least one multiletter word, convert NEWTEXT to all caps.
Otherwise if all words are capitalized in the replaced text,
capitalize each word in NEWTEXT.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2003-05-16 21:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-16 14:16 case conversion by replace-match Roland Winkler
2003-05-16 19:47 ` Stefan Monnier
2003-05-16 21:07 ` Andreas Schwab [this message]
[not found] ` <mailman.6326.1053119374.21513.bug-gnu-emacs@gnu.org>
2003-05-16 21:32 ` Kevin Rodgers
2003-05-16 21:51 ` Andreas Schwab
2003-05-17 13:50 ` Richard Stallman
[not found] ` <mailman.6339.1053179576.21513.bug-gnu-emacs@gnu.org>
2003-05-17 20:09 ` Roland Winkler
2003-05-19 20:24 ` Kevin Rodgers
2003-05-21 1:55 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jehe7u7g83.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=bug-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.