all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: help-gnu-emacs@gnu.org
Subject: Re: Alternative to string< that works "well" with unicode
Date: Fri, 28 Nov 2014 09:43:50 +0100	[thread overview]
Message-ID: <87wq6f4svt.fsf@gmx.us> (raw)
In-Reply-To: 83ppc7n34g.fsf@gnu.org

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Rasmus <rasmus@gmx.us>
>> Date: Fri, 28 Nov 2014 01:32:00 +0100
>
>> 
>> > I think Emacs bug#18051 is relevant.
>> 
>> Thanks, the bug pointed me to `string-collate-lessp':
>> 
>> (sort '(É E T A À Z) 'string-collate-lessp)
>>       => (A À E É T Z)
>> 
>> Pretty cool!
>
> Yes, it is.  But please be aware that the results are heavily
> locale-dependent; in particular, a non-UTF-8 locale on a typical
> GNU/Linux system might behave very differently.  Likewise on systems
> where the standard C library is not glibc.
>
> The upshot of all this is that the results of such sorting are
> excellent from the local user POV, but should not be considered as
> stable across locales and systems, and therefore Lisp programs that
> are expected to be distributed should not rely on the resulting order
> too much.

The particular usecase I  had in mind is sorting in EMMS.  Here,
local-dependent sorting seems like a plus, and the particular order is not
so interesting.

Thanks everyone!

—Rasmus

-- 
There are known knowns; there are things we know that we know




  reply	other threads:[~2014-11-28  8:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.14831.1417128158.1147.help-gnu-emacs@gnu.org>
2014-11-27 23:52 ` Alternative to string< that works "well" with unicode Pascal J. Bourguignon
2014-11-28  0:06   ` Yuri Khan
2014-11-28  0:32     ` Rasmus
2014-11-28  8:25       ` Eli Zaretskii
2014-11-28  8:43         ` Rasmus [this message]
2014-11-27 22:42 Rasmus

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

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

  git send-email \
    --in-reply-to=87wq6f4svt.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.