org-table-sort-lines: Fix case-sensitive sorting
commit88bf8aef2812ac8baec27bf61084aafff36e3f56
authorSebastian Reuße <seb@wirrsal.net>
Sun, 11 Mar 2018 15:43:51 +0000 (11 16:43 +0100)
committerNicolas Goaziou <mail@nicolasgoaziou.fr>
Tue, 13 Mar 2018 08:09:54 +0000 (13 09:09 +0100)
treead4bf169d3065178d5d50f686ea1d169461e5289
parent8e9518a3b0996c24e287dbf60d1b2d2cbb4e7b60
org-table-sort-lines: Fix case-sensitive sorting

* org-table.el (org-table-sort-lines): Fix case sensitive sorting,
improve docstring.
* test-org-table.el (test-org-table/sort-lines): Enforce C locale when
testing alphabetic sorting.

‘sort-subr’ ignores ‘sort-fold-case’ when a predicate is provided. To
correctly handle case-sensitivity, we now bake it into the predicate.

Since we are now sorting according to the user’s locale, WITH-CASE
will not make a difference in most instances, since most locales
always sort case-insensitively (cf. how GNU sort ignores the ‘-f’
switch).  We now mention this in the function docstring.

In order to meaningfully test case-sensitive sorting, we now enforce
the C locale in the respective unit test.
lisp/org-table.el
testing/lisp/test-org-table.el