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: Tue, 8 Sep 2015 14:46:00 -0700 (PDT)

>   > Personally, yes, I would get rid of that anomaly too at some
>   > point, but I'm not proposing that now.  Likewise, for the
>   > anomaly that whitespace folding is switched off by SPC SPC.
> 
> SPC SPC should match only a pair of spaces!

This is not the topic of this thread.  But if and when we get to
that discussion (if I'm still around in 20 years ;-)), the right
answer is the same as for the current proposal, which is about
char folding:

Just toggle whitespace-folding OFF.  "Just say NO" to SPC SPC
matching any string of whitespace.  Whitespace folding will stay
off as long as you do not toggle it ON.  And you can customize
the default behavior so that it starts either ON or OFF.

(I'm not a fan of whitespace folding most of the time, so I
will turn it OFF by default, personally.  I do want SPC SPC
to match only two consecutive spaces, nearly all the time.)

The simple idea is that folding is either on or off.
When on, equivalence classes are used - whether for diacritics
("char folding"), or for case (case folding), or for whitespace
(whitespace folding).

But that's just a preview of a possible FUTURE discussion.
No one is proposing NOW that we change the current behavior
of case folding or whitespace folding.  The topic here, now,
is char folding - whether it should treat all chars of a class
the same or not.

What do you LOSE with the proposed behavior (for char folding
now, and perhaps for case or whitespace folding later)?  You
lose the fact that any particular members of an equivalence
class are "canonical", and so using one of them during folding
automatically switches folding off.

E.g., currently, using é in a search string turns char folding
off.  And of course using an uppercase char turns case folding
off.  And SPC SPC turns whitespace folding off.

What do you GAIN with the proposed behavior?  You need not
type a particular, privileged member of a class in order to
match any member of the class.  Any member will match any
member (including itself, of course).

The point is to have users explicitly hit a key to toggle folding.
That enables the use of any char in a class to match any other
char in the same class.  That's the tradeoff.

With the proposal, there is nothing to remember, no exceptions
or special rules.  Folding is either on or off, and a single
key toggles it (for each kind of folding).



reply via email to

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