[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regex and case-fold-search problem
From: |
Stefan Monnier |
Subject: |
Re: regex and case-fold-search problem |
Date: |
Sun, 25 Aug 2002 14:52:41 -0400 |
> In article <address@hidden>, "Stefan Monnier" <monnier+gnu/address@hidden>
> writes:
> > But I think that if it works with (case-fold-search nil) it should
> > also work with (case-fold-search t). The current behavior is really
> > counter-intuitive.
>
> I agree.
>
> >> But, anyway, we have to decide what to do.
> >>
> >> (1) Regard the above case as a bug, and fix it completely.
> >> As we don't support a range striding over different
> >> charsets by the current Emacs, I think the fix is
> >> difficult but not that much. But, in emacs-unicode, we
> >> can't have such a restriction, and thus the fix is very
> >> difficult.
>
> > For ASCII it's pretty easy to fix. But for other charsets, it's
> > indeed more tricky. Maybe we can simply use the smallest contiguous
> > range of chars that includes all the chars we should match,
> > so the behavior is indeed "implementation-defined" (in the sense
> > that it's not necessarily obvious to the user what happens) but
> > it's at least less confusing (in the sense that (case-fold-search t)
> > matches at least as much as (case-fold-search nil)).
>
> Ideally, the range "[A-_]" must be converted to "[a-z[-_]".
Indeed and the (new) current code does just that for ASCII.
> But, it seems that your idea is to convert "[A-_]" to
> "[_-z]", correct? I agree that it results in less
> counter-intuitive behaviour.
Not quite: [_-z] would not include [ \ ] and ^.
So instead it's [[-z] which includes all of [a-z[-_]
as well as ` (in this particular case).
> > How about the patch below ?
> [...]
> ?? It seems that the patch handles only non-ASCII chars.
Well, that's because the code for ASCII was already there (just
didn't work right because we did PATFETCH instead of PATFETCH_RAW).
Stefan
- Re: regex and case-fold-search problem, (continued)
- Re: regex and case-fold-search problem, Richard Stallman, 2002/08/26
- Re: regex and case-fold-search problem, Eli Zaretskii, 2002/08/24
- Re: regex and case-fold-search problem, Kenichi Handa, 2002/08/25
- Re: regex and case-fold-search problem, Miles Bader, 2002/08/25
- Re: regex and case-fold-search problem, Kim F. Storm, 2002/08/25
Re: regex and case-fold-search problem, Stefan Monnier, 2002/08/23
Re: regex and case-fold-search problem, Kai Großjohann, 2002/08/24
Re: regex and case-fold-search problem, Richard Stallman, 2002/08/26
- Re: regex and case-fold-search problem, Kenichi Handa, 2002/08/29
- Re: regex and case-fold-search problem, Kim F. Storm, 2002/08/29
- Re: regex and case-fold-search problem, Kenichi Handa, 2002/08/29
- Re: regex and case-fold-search problem, Kim F. Storm, 2002/08/29
- Re: regex and case-fold-search problem, Stefan Monnier, 2002/08/29
- Re: regex and case-fold-search problem, Kenichi Handa, 2002/08/29
- Re: regex and case-fold-search problem, Richard Stallman, 2002/08/30