From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heikki Lehvaslaiho Subject: Re: bug: org-table-sort-lines does only case sensitive alphabetical sorting Date: Tue, 17 Jul 2018 09:24:23 +0300 Message-ID: References: <87sh4zrn7i.fsf@nicolasgoaziou.fr> <87bmbaw5cf.fsf@nicolasgoaziou.fr> <87efg6ov77.fsf@wirrsal.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007b4bc205712c00bf" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffJPi-0001fp-TP for emacs-orgmode@gnu.org; Tue, 17 Jul 2018 02:24:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffJPh-00049O-El for emacs-orgmode@gnu.org; Tue, 17 Jul 2018 02:24:46 -0400 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:34148) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ffJPh-00049C-6d for emacs-orgmode@gnu.org; Tue, 17 Jul 2018 02:24:45 -0400 Received: by mail-oi0-x234.google.com with SMTP id 13-v6so79506679ois.1 for ; Mon, 16 Jul 2018 23:24:44 -0700 (PDT) In-Reply-To: <87efg6ov77.fsf@wirrsal.net> 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: =?UTF-8?Q?Sebastian_Reu=C3=9Fe?= Cc: emacs-orgmode@gnu.org, Nicolas Goaziou --0000000000007b4bc205712c00bf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for replies, I am using: GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018-05-31 This is what I get: (string-collate-lessp "a" "x" "de_DE.utf-8" nil) ; t (string-collate-lessp "a" "X" "de_DE.utf-8" t) ; nil (string-collate-lessp "a" "x" "fi_FI.utf-8" nil) ; t (string-collate-lessp "a" "X" "fi_FI.utf-8" t) ; nil I think I have lost the sense how Emacs language environments work after struggling for years with buffers getting automatically converted to Latin-1. I started setting all possible variables to 'UTF-8 and finally something did it. Now I tried again various values to see if they affect the org table sorting: (set-language-environment 'utf-8) (set-language-environment 'English) (set-language-environment 'Swedish) (setq locale-coding-system 'utf-8) (setq locale-coding-system 'fi_FI.utf-8) (setq locale-coding-system 'de_DE.utf-8) (setq locale-coding-system 'en_GB.utf-8) Unfortunately none of these made any difference. Any suggestions? I am testing sorting in a simple one column table: | a | | c | | B | | D | -Heikki Heikki Lehv=C3=A4slaiho - skype:heikki_lehvaslaiho cell: +358 40 850 6640 http://about.me/heikki On 14 July 2018 at 15:31, Sebastian Reu=C3=9Fe wrote: > Hello Nicolas, hello Heikki, > > > Heikki Lehvaslaiho writes: > > >> I can not see any change in function with the new code. Alphabetical > >> sorting is fixedly case sensitive. > > Is your Emacs=E2=89=A424? Emacs (surprisingly) only gained a facility for > alphabetic (locale-sensitive) sorting with ver.=E2=80=AF25. Before that, = we will > resort to using =C2=ABstring-lessp=C2=BB, which only sorts lexicographica= lly (i.e, > based on the binary character value, which means it is always > case-sensitive on Unicode systems). > > If you are using GNU Emacs=E2=89=A525, what locale are you using? FI_fi a= nd most > of the other western locales are based on ISO-14651, so you should > always get case-*in*sensitive orderings, which is what I get with Emacs > 26.1. So, evaluating the following should all yield =C2=ABt=C2=BB: > > (string-collate-lessp "a" "x" "de_DE.utf-8" nil) > (string-collate-lessp "a" "X" "de_DE.utf-8" t) > (string-collate-lessp "a" "x" "fi_FI.utf-8" nil) > (string-collate-lessp "a" "X" "fi_FI.utf-8" t) > > Kind regards, > > Sebastian > > -- > Insane cobra split the wood > Trader of the lowland breed > Call a jittney, drive away > In the slipstream we will stay > --0000000000007b4bc205712c00bf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for replies,

I am using:
GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Ve= rsion 10.10.5 (Build 14F2511)) of 2018-05-31


This is what= I get:

=C2=A0 =C2=A0 (string-collate-lessp "a" &qu= ot;x" "de_DE.utf-8" nil) ; t
=C2=A0 =C2=A0 (string= -collate-lessp "a" "X" "de_DE.utf-8" t) ; nil=
=C2=A0 =C2=A0 (string-collate-lessp "a" "x" = "fi_FI.utf-8" nil) ; t
=C2=A0 =C2=A0 (string-collate-le= ssp "a" "X" "fi_FI.utf-8" t) ; nil

<= br>
I think I have lost the sense how Emacs language environments work<= /div>
after struggling for years with buffers getting automatically
converted to Latin-1. I started setting all possible variables to
'UTF-8 and finally something did it.

Now I tried = again various values to see if they affect the org table
sorting:=

(set-language-environment 'utf-8)
(set-languag= e-environment 'English)
(set-language-environment 'Swedis= h)

(setq locale-coding-system 'utf-8)
(setq loc= ale-coding-system 'fi_FI.utf-8)
(setq locale-coding-system &#= 39;de_DE.utf-8)
(setq locale-coding-system 'en_GB.utf-8)
Unfortunately none of these made any difference. Any suggestions?=

I am testing sorting in a simple one column table:

=
| a |
| c |
| B |
| D |



=C2=A0 =C2=A0=C2=A0 -Heikki

Heikki Lehv=C3=A4slaiho - skype:heikki_lehvas= laiho=C2=A0cell:=C2=A0+358 40 850 66= 40
http://about.me/heikki

On 14 July 2018 at 15:31, Sebastian Reu=C3= =9Fe <seb@wirrsal.net> wrote:

> Heikki Lehvaslaiho <heikki.lehvaslaiho@gmail.com> writes:

>> I can not see any change in function with the new code. Alphabetic= al
>> sorting is fixedly case sensitive.

Is your Emacs=E2=89=A424? Emacs (surprisingly) only gained a facilit= y for
alphabetic (locale-sensitive) sorting with ver.=E2=80=AF25. Before that, we= will
resort to using =C2=ABstring-lessp=C2=BB, which only sorts lexicographicall= y (i.e,
based on the binary character value, which means it is always
case-sensitive on Unicode systems).

If you are using GNU Emacs=E2=89=A525, what locale are you using? FI_fi and= most
of the other western locales are based on ISO-14651, so you should
always get case-*in*sensitive orderings, which is what I get with Emacs
26.1. So, evaluating the following should all yield =C2=ABt=C2=BB:

=C2=A0 =C2=A0 (string-collate-lessp "a" "x" "de_DE= .utf-8" nil)
=C2=A0 =C2=A0 (string-collate-lessp "a" "X" "de_DE= .utf-8" t)
=C2=A0 =C2=A0 (string-collate-lessp "a" "x" "fi_FI= .utf-8" nil)
=C2=A0 =C2=A0 (string-collate-lessp "a" "X" "fi_FI= .utf-8" t)

Kind regards,

Sebastian

--
Insane cobra split the wood
Trader of the lowland breed
Call a jittney, drive away
In the slipstream we will stay

--0000000000007b4bc205712c00bf--