emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: char equivalence classes in search - why not symmetric?


From: Drew Adams
Subject: RE: char equivalence classes in search - why not symmetric?
Date: Thu, 10 Sep 2015 08:02:43 -0700 (PDT)

> >>> They are equivalence classes.  The chars are equivalent when searched
> >>> for (with char folding turned on).
> >>
> >> No, they aren't.  For instance, A and Á are not equivalent in search.
> >> Searching for A will match Á, but searching for Á will not match A.
> >
> > Please read what I said: "The chars are equivalent when searched for."
> >                                                    ^^^^^^^^^^^^^^^^^

(with char-fold search, i.e., ignoring diacritics - that's the context)

> They aren't.  Searching with the search string "Á" will find "Á" but
> not "A".

For anyone who really still does not understand, and anyone who might
be pretending not to understand ;-):

When search is case-insensitive, occurrences of a and A in the
searched text are found equivalently.  As search targets, a and A are
equivalent for case-insensitive search.

If you ask to find an occurrence of the first letter of the English
alphabet, and you say that you don't care about case, you find, as you
expect, either a or A, indifferently.

a and A in the searched text are treated the same by case folding.
They form an equivalence class in this context.

But in Emacs, if you put A in the search string then you inhibit, turn
OFF, blow away case-insensitive search - case is no longer folded.  So
of course any statement about the behavior of case-fold search is
irrelevant then.

Likewise, for char folding.

When char folding is on, A and Á in the searched text are found
equivalently.  As search targets, A and Á are equivalent for char-fold
search.

If you don't care about diacritics, you can expect to find either A or
Á, indifferently, and you do, when char folding is in effect.

A and Á in the searched text are treated the same by char folding.
They form an equivalence class in this context.

But in Emacs, currently, if you put Á in the search string then you
inhibit, turn OFF, blow away char-fold search.  So of course any
statement about the behavior of char-fold search is irrelevant then.

a and A for case folding, and A and Á for char folding, form
equivalence classes wrt being found in searched text.  Case folding
does NOT apply if you put A in the search string.  Char folding does
NOT apply if you put Á in the search string.

Ulrich Müller CANNOT search for his last name using Müller in the
search string and have search ignore diacritics, so that it matches
indifferently Müller and Muller.  That is, char folding simply DOES
NOT WORK here - verboten.  (He can of course use regexp search to work
around the limitation.)

> > I did *not* say, as you say, that they are "equivalent in search."
> > I tried to carefully distinguish the two uses of the chars: when used
> > as search targets (they are currently equivalent) vs when used in the
> > search string (they are not equivalent, currently).
> 
> Yes, there is a distinction between search targets and search spec.  But
> they are different in either category.

Indeed, sigh.

The point of the proposal of this thread is to _allow_ users to search
_using char folding_ regardless of whether there are diacritics in the
search string.  They would still be able to use search without char
folding, e.g., to search for Á and find only Á, not also A.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]