[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strip accents and sorting [was: BibTeX issues]
From: |
Roland Winkler |
Subject: |
Re: strip accents and sorting [was: BibTeX issues] |
Date: |
Fri, 30 Aug 2019 14:09:47 -0500 |
On Fri Aug 30 2019 Eli Zaretskii wrote:
> > You could set LC_COLLATE=en_US.utf8 inside Emacs, or even bind it
> > around the call to string-collate-lessp. I think we support that on
> > GNU/Linux.
>
> Actually, string-collate-lessp accepts an optional argument LOCALE
> that can be used for that. So it's even easier than I remembered.
Thanks! Unfortunately, string-collate-lessp with locale en_US.utf8
folds case,
(sort '("b" "A" "B" "a")
(lambda (s1 s2) (string-collate-lessp s1 s2 "en_US.utf8")))
⇒ ("a" "A" "b" "B")
whereas
(sort '("b" "A" "B" "a")
(lambda (s1 s2) (string-collate-lessp s1 s2 "C")))
⇒ ("A" "B" "a" "b")
though in both cases the optional arg IGNORE-CASE of
string-collate-lessp is nil. (I guess this is not a bug of
string-collate-lessp, but it is an intended "feature" of the locale
en_US.utf8.)
Similarly, the locale en_US.utf8 ignores dots "." which for my taste
bundles too many features. (Does anybody know where the feature
bundles of different locales are described? So far, I have not
found anything.)
But something like bibtex-mode could introduce a new user option
bibtex-sort-locale that is used as optional arg when sorting BibTeX
records with string-collate-lessp.
- BibTeX issues, Joost Kremers, 2019/08/27
- Re: BibTeX issues, Roland Winkler, 2019/08/28
- Re: BibTeX issues, Eli Zaretskii, 2019/08/28
- strip accents and sorting [was: BibTeX issues], Roland Winkler, 2019/08/28
- Re: strip accents and sorting [was: BibTeX issues], martin rudalics, 2019/08/29
- Re: strip accents and sorting [was: BibTeX issues], Roland Winkler, 2019/08/30
- Re: strip accents and sorting [was: BibTeX issues], Eli Zaretskii, 2019/08/30
- Re: strip accents and sorting [was: BibTeX issues], Eli Zaretskii, 2019/08/30
- Re: strip accents and sorting [was: BibTeX issues],
Roland Winkler <=
- Re: strip accents and sorting [was: BibTeX issues], Eli Zaretskii, 2019/08/30
- Re: strip accents and sorting [was: BibTeX issues], Roland Winkler, 2019/08/30
- Re: strip accents and sorting [was: BibTeX issues], Eli Zaretskii, 2019/08/31
- Re: strip accents and sorting [was: BibTeX issues], Eli Zaretskii, 2019/08/29
- Re: strip accents and sorting [was: BibTeX issues], Roland Winkler, 2019/08/30
Re: BibTeX issues, Joost Kremers, 2019/08/29