emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastian Reuße" <seb@wirrsal.net>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Fix alphabetic sorting for headlines, tags
Date: Sun, 11 Feb 2018 12:11:12 +0100	[thread overview]
Message-ID: <87sha7g4rz.fsf@wirrsal.net> (raw)
In-Reply-To: <87r2ptc813.fsf@nicolasgoaziou.fr>

Hello Nicolas,

Nicolas Goaziou <mail@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

  reply	other threads:[~2018-02-11 11:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 10:07 [PATCH] Fix alphabetic sorting for headlines, tags Sebastian Reuße
2018-02-10 13:02 ` Nicolas Goaziou
2018-02-11 11:11   ` Sebastian Reuße [this message]
2018-02-11 16:25     ` Nicolas Goaziou
2018-02-12  8:44       ` Sebastian Reuße
2018-02-12 14:03         ` Nicolas Goaziou
2018-02-12 14:54           ` Sebastian Reuße
2018-02-12 15:47             ` Nicolas Goaziou
2018-02-12  8:46       ` Sebastian Reuße
2018-02-12 13:59         ` Nicolas Goaziou
2018-02-11 11:13   ` Sebastian Reuße
  -- strict thread matches above, loose matches on Subject: below --
2018-02-06  8:57 Sebastian Reuße

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87sha7g4rz.fsf@wirrsal.net \
    --to=seb@wirrsal.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).