Hello Nicolas, Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:
> However, Org 9.X still supports Emacs 24, so we cannot use > `string-collate-lessp without degrading gracefully to `string-lessp' > in these Emacsen. > We could add `org-string-collate-lessp' to "org-compat.el", which > would be an alias for `string-collate-lessp' on Emacs 25+ and to > `string-lessp' otherwise. Thanks, I would not have suspected collated sorting to be so recent. I added a proxy function to «org-compat.el». >> +(defun org-string-collate-greaterp (s1 s2 &optional locale ignore-case) >> + "Return t if S1 is greater than S2 in collation order. > > Return non-nil if... Fixed. > We would also need tests for that feature. For coverage purposes I added a test for the «string-collate-greaterp» wrapper. 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. Let me know what you think. Kind regards, SR -- Insane cobra split the wood Trader of the lowland breed Call a jittney, drive away In the slipstream we will stay