unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Roland Winkler" <winkler@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rudalics@gmx.at, emacs-devel@gnu.org
Subject: Re: strip accents and sorting [was: BibTeX issues]
Date: Fri, 30 Aug 2019 14:09:47 -0500	[thread overview]
Message-ID: <29819.36697.297846.23913@gargle.gargle.HOWL> (raw)
In-Reply-To: <837e6ua47y.fsf@gnu.org>

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.



  reply	other threads:[~2019-08-30 19:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27  8:40 BibTeX issues Joost Kremers
2019-08-28 17:45 ` Roland Winkler
2019-08-28 18:45   ` Eli Zaretskii
2019-08-29  3:26     ` strip accents and sorting [was: BibTeX issues] Roland Winkler
2019-08-29  6:15       ` martin rudalics
2019-08-30 16:27         ` Roland Winkler
2019-08-30 17:51           ` Eli Zaretskii
2019-08-30 18:38             ` Eli Zaretskii
2019-08-30 19:09               ` Roland Winkler [this message]
2019-08-30 19:19                 ` Eli Zaretskii
2019-08-30 19:49                   ` Roland Winkler
2019-08-31  6:45                     ` Eli Zaretskii
2019-08-29  7:10       ` Eli Zaretskii
2019-08-30 16:29         ` Roland Winkler
2019-08-29  7:49   ` BibTeX issues Joost Kremers
2019-08-30 19:18     ` Roland Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29819.36697.297846.23913@gargle.gargle.HOWL \
    --to=winkler@gnu.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).