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, 1 Sep 2015 17:33:37 -0700 (PDT)

> Or in a brief table:
> 
> ‘C-s a’     matches [aA]
> ‘C-s a M-c’ matches [a]
> ‘C-s A’     matches [A]
> ‘C-s A M-c’ matches [aA]
> 
> Substituting ‘A’ into ‘ä’ (other equivalent chars omitted for brevity):
> 
> ‘C-s a’     matches [aä]
> ‘C-s a M-'’ matches [a]
> ‘C-s ä’     matches [ä]
> ‘C-s ä M-'’ matches [aä]
> 
> I see no problem implementing the same.

Did you mean `M-s '' insteaed of `M-''?  If so, except for the last
line, that's what we have now, IIUC.

And yes, that would be one way to do it (get the 4 match possibilities
I requested).  Gets my vote.

> BTW, could this scheme be applied to whitespace matching as well?
> 
> ‘C-s SPC’         matches [SPC TAB]
> ‘C-s SPC M-s SPC’ matches [SPC]
> ‘C-s TAB’         matches [TAB]
> ‘C-s TAB M-s SPC’ matches [SPC TAB]

Sounds good to me.  Again, gets my vote.

But in each case, I would want there to be a user option that
controls the default behavior, just as `case-fold-search' does.

That should be the first fix, as I mentioned earlier: change
`character-fold-search' to a defcustom.  Let a user decide
which default behavior s?he wants for char folding - and
whitespace folding as well.

It is very handy to me that search always starts by default
by respecting case, because my customized value of 
`case-fold-search' is nil.  I would not want to have to
do `M-c' each time I start a search.  Likewise, for char
folding (`M-s '') and whitespace folding (`M-s SPC').

> > How did that upper-case letter get there?  Commands like C-w are careful
> > not to add uppercase letters if there aren't already some.  So the user
> > must have typed it explicitly, and so they were paying attention to case
> > and have no need for a case-insensitive search.  The only harm is if
> > they are inconsistent in their typing -- during something as brief as
> > isearch.
> 
> Yanking a string with upper-case letters into Isearch does more harm
> by converting them into lower-case.  I believe yanking a string
> should not strip diacritics either.

That too gets my vote - WYYIWYG: what you yank is what you get.



reply via email to

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