emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Fix alphabetic sorting for headlines, tags


From: Sebastian Reuße
Subject: Re: [O] [PATCH] Fix alphabetic sorting for headlines, tags
Date: Mon, 12 Feb 2018 09:44:03 +0100
User-agent: mu4e 1.0-alpha3; emacs 25.3.1

Nicolas Goaziou <address@hidden> writes:

> Sebastian Reuße <address@hidden> writes:
>
>> I also considered adding a regression test for non-ASCII chars to
>> «test-org/sort-entries», but for stable results, one would have to
>> enforce some canonical locale. Unfortunately, it’s not possible to
>> change the locale at Emacs run-time; Emacs only seems to call
>> «setlocale()» once during initialization, so «wcscoll()» always collates
>> according to the initial value of «LC_COLLATE». A regression test would
>> thus require changes to the Makefile, and tests might yield different
>> results when run from inside an existing Emacs process, so I left the
>> «sort-entries» test as is.
>
> It should be possible to redefine `string-collate-lessp', using
> `cl-letf' so that is uses different locales as the optional argument.
> WDYT?

That would work. Though it does tie up the test with an
implementation-detail. Still, probably better than no regression test at
all.

The test will error out if the data for the chosen locale isn’t actually
present on the system. I chose the «en_US» locale in the hopes that this
will frequently be installed. I’ll leave it up to you to decide whether
that is acceptable.

> The patch looks good. Thank you. It would be good to add an entry in
> ORG-NEWS about it, however.

Added.

> Then we can improve `org-table-sort-lines' accordingly. It can be done
> in another patch, tho.

That’s a good idea, I’ll look into it if I have some time by the end of
the week.

Kind regards,
SR

-- 
Insane cobra split the wood
Trader of the lowland breed
Call a jittney, drive away
In the slipstream we will stay



reply via email to

[Prev in Thread] Current Thread [Next in Thread]