From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Subject: [PATCH 1/6] Fix alphabetic sorting for tables, plain lists Date: Sun, 11 Mar 2018 16:43:47 +0100 Message-ID: <20180311154352.16920-1-seb@wirrsal.net> 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]:51462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev39d-0000V3-Gd for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 11:44:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ev39a-0008Kj-Ej for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 11:44:57 -0400 Received: from wirrsal.net ([188.68.36.149]:42788 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 1ev39a-0008Jf-4V for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 11:44:54 -0400 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: emacs-orgmode@gnu.org Cc: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= * org-table.el (org-table-sort-lines): Use collated sorting. * org-list.el (org-sort-list): Use collated sorting. Cf. commit 551d2f1fe. --- etc/ORG-NEWS | 6 ++++++ lisp/org-list.el | 5 +++-- lisp/org-table.el | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index dbedbf7c9..77373d442 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -106,6 +106,12 @@ document, use =3Dshrink=3D value instead, or in addi= tion to align: ,#+STARTUP: align shrink #+END_EXAMPLE =20 +*** Alphabetic sorting in tables and lists + +When sorting alphabetically, ~org-table-sort-lines~ and ~org-sort-list~ +now sort according to the locale=E2=80=99s collation rules instead of by +code-point. + ** New features *** Add support for links to LaTeX equations in HTML export Use MathJax links when enabled (by ~org-html-with-latex~), otherwise diff --git a/lisp/org-list.el b/lisp/org-list.el index 9e015cdc2..d646e264c 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2804,7 +2804,8 @@ (defun org-sort-list by a time stamp, by a property or by priority. =20 Comparing entries ignores case by default. However, with an -optional argument WITH-CASE, the sorting considers case as well. +optional argument WITH-CASE, the sorting considers case as well, +if the current locale allows for it. =20 The command prompts for the sorting type unless it has been given to the function through the SORTING-TYPE argument, which needs to @@ -2850,7 +2851,7 @@ (defun org-sort-list (error "Missing key extractor")))) (sort-func (cond - ((=3D dcst ?a) #'string<) + ((=3D dcst ?a) #'org-string-collate-lessp) ((=3D dcst ?f) (or compare-func (and interactive? diff --git a/lisp/org-table.el b/lisp/org-table.el index f303c2581..316533172 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -1794,7 +1794,7 @@ (defun org-table-sort-lines (predicate (cl-case sorting-type ((?n ?N ?t ?T) #'<) - ((?a ?A) #'string<) + ((?a ?A) #'org-string-collate-lessp) ((?f ?F) (or compare-func (and interactive? --=20 2.16.2