[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: extending case-fold-search to remove nonspacing marks (diacritics et
From: |
Artur Malabarba |
Subject: |
Re: extending case-fold-search to remove nonspacing marks (diacritics etc.) |
Date: |
Thu, 5 Feb 2015 23:17:42 +0000 |
As for answering your questions:
>> implementing it for users so it works like `case-fold-search' (you just
>> set something in Customize and all search commands DWYM) seems much
>> harder.
Doing it as part of Emacs is not terribly hard, but it has
disadvantages. Namely, the case-fold-search machinery only relates one
character to another character (1 to 1). At least for latin this would
be enough a lot of the time, e.g. you can use it to relate "á" to "a".
However, there's another way of writing "á" which takes two
characters, and this situation can't be handled (AFAIK) by the
case-fold-search machinery.
The bright side is that I think this two-char way of writing latin
accents is much less common (not 100% sure though, it's hard to tell
the difference). The downside is that I know nothing about other
languages, so maybe using two chars to represent one char is the
default behavior in some other languages?
>> Does anyone have suggestions? Maybe some defadvice magic?
You can use a defadvice around one of the isearch internal functions
(check out the branch I mentioned) to implement something in elisp.
And you can redefine the buffer's case-folding table and use that in
the advice, but that will require that you generate the entire table.
- extending case-fold-search to remove nonspacing marks (diacritics etc.), Ted Zlatanov, 2015/02/05
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Artur Malabarba, 2015/02/05
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.),
Artur Malabarba <=
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Juri Linkov, 2015/02/05
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Artur Malabarba, 2015/02/05
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Artur Malabarba, 2015/02/05
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Eli Zaretskii, 2015/02/06
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Artur Malabarba, 2015/02/06
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Eli Zaretskii, 2015/02/06
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Artur Malabarba, 2015/02/06
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Eli Zaretskii, 2015/02/06
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Stephen J. Turnbull, 2015/02/05
- Re: extending case-fold-search to remove nonspacing marks (diacritics etc.), Eli Zaretskii, 2015/02/06