From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian =?utf-8?Q?Reu=C3=9Fe?= Subject: Re: [PATCH] Fix alphabetic sorting for headlines, tags Date: Sun, 11 Feb 2018 12:11:12 +0100 Message-ID: <87sha7g4rz.fsf@wirrsal.net> References: <20180206100705.32256-1-seb@wirrsal.net> <87r2ptc813.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekpXX-0001nA-Tw for emacs-orgmode@gnu.org; Sun, 11 Feb 2018 06:11:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekpXT-000814-GS for emacs-orgmode@gnu.org; Sun, 11 Feb 2018 06:11:23 -0500 Received: from wirrsal.net ([188.68.36.149]:38326 helo=mail.wirrsal.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ekpXT-0007xI-62 for emacs-orgmode@gnu.org; Sun, 11 Feb 2018 06:11:19 -0500 In-reply-to: <87r2ptc813.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Hello Nicolas, Nicolas Goaziou 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 =C2=ABorg-compat.el=C2=BB. >> +(defun org-string-collate-greaterp (s1 s2 &optional locale ignore-cas= e) >> + "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 =C2=ABstring-collate-greater= p=C2=BB wrapper. I also considered adding a regression test for non-ASCII chars to =C2=ABtest-org/sort-entries=C2=BB, but for stable results, one would have= to enforce some canonical locale. Unfortunately, it=E2=80=99s not possible t= o change the locale at Emacs run-time; Emacs only seems to call =C2=ABsetlocale()=C2=BB once during initialization, so =C2=ABwcscoll()=C2= =BB always collates according to the initial value of =C2=ABLC_COLLATE=C2=BB. A regression te= st 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 =C2=ABsort-entries=C2=BB test as is. Let me know what you think. Kind regards, SR --=20 Insane cobra split the wood Trader of the lowland breed Call a jittney, drive away In the slipstream we will stay