On Tue, Aug 31, 1999 at 11:24:24AM +0200, Didier Verna wrote:
Stef Epardaud <stef(a)lunatech.com> wrote:
> now i know the replace is case-sensitive if the FROM argument has case, but
> should it not be case sensitive as well if the TO argument has case when the
> FROM does not have ?
No. You search for a /pattern/, you replace with a /string/. If you
have `case-fold-search' to non-nil, it's convenient that XEmacs notice the
uppercase character in FROM, and deduce that you actually want
case sensitiveness. Moerover it's coherent with what interactive searches do.
It doesn't make sense to toggle case sensitiveness according to the TO string.
well, it deduces case-sensitivity from uppercase characters in the FROM,
but what do you think the user expects when he wants to replace 'blabla'
with 'blaBla', really ?
there _is_ case-sensitivity to be detected very easily i think.
> so it did after all what i wanted, but still it did match 'ObjectName'
> which i didn't want it to match. actually i think it would make sense to
> make it case-sensitive if there are case in any of the 2 arguments .
Again, no, because what you want to do is more complex than what the
feature is for. You actually want a different treatment for one character in
the string, being uppercase or lowercase. That's the kind of thing
query-replace-regexp is for. You can query-replace-regexp "object[n\\|N]ame",
in which XEmacs will notice the uppercase letter and deduce you want
temporarily case sensitiveness. This won't match "ObjectName".
no it's not that complex, it's just that case-sensitivity can also be
detected in the TO string, if it has not been in the FROM.
what other meaning could that possibly be ?
i mean, if i don't put any uppercase letters in FROM but specifically
put some in TO, does it not mean i _want_ case-sensitivity ?
the opposite works: case in FROM and none in TO is case-sensitive
i can replace 'objectName' by 'objectname' but not 'objectname'
to me it does not make sense.
For really complex stuff, you'll have no choice but toggle manually
case sensitiveness as you wish, but this is a good thing. Let's not complicate
the existing functions. And writing `query-replace-with-case' takes 3 lines.
i guess i'll have to do with it, but i don't want a case-sensitive
search, just that if you can detect the user's will in the FROM, i would
expect a case in TO and not FROM could not mean anything else but a
request for case-sensitivity.
> tell me i am wrong, or better make this an option, or am i so
> don't deserve an option ? :-/
You're so wrong you don't deserve an option :-)
nevermind, i'll do mine if i can and will keep it secret ;)
# Stef Epardaud, # There is no limit to the power of computing ...
# Java Defeater # ... except men maybe ?
# Earth # Lunatech Research,
# Solar System # soon we will quit researching and start finding...