Subject: Re: bug#59275: Unexpected return value of `string-collate-lessp' on Mac
From: Eli Zaretskii <[email-masked]>
To: Ihor Radchenko <[email-masked]>
Cc: [email-masked]
Date: Tue, 22 Nov 2022 14:56:14 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Ihor Radchenko <[email-masked]>
> Cc: [email-masked]
> Date: Tue, 22 Nov 2022 01:24:43 +0000
> 
> > Once again: locale-specific collation order is inherently unpredictable in
> > its results, and should only be used when the locale-specific order is a
> > _must_, like when sorting people's names for a telephone directory.
> 
> We use string collation for
> 
> 1. Sorting bibliographies
> 2. Sorting lists
> 3. Sorting table lines
> 4. Sorting tags
> 5. Sorting headings
> 6. Sorting entries in agendas
> 7. As a criterion for agenda/tag filtering when comparison operator is
>    used on string property values (11.3.3 Matching tags and properties)
> 
> 1-6 should follow the locale.

I think only 1 and 6 are firmly in that category.  For the others it depends
on whether the results of the sorting are immediately displayed, or used for
further processing.  In the former case, using string-collate-lessp is
semi-okay ("semi" because producing different results in different locales
can still confuse users); in the latter case it is wrong, IMO, because you
will cause unexpected results.

> See the attached patch.

Thanks, installed.