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: Thu, 19 Jul 2018 10:29:31 +0300 Message-ID: References: <87sh4zrn7i.fsf@nicolasgoaziou.fr> <87bmbaw5cf.fsf@nicolasgoaziou.fr> <87efg6ov77.fsf@wirrsal.net> <87y3ea4abe.fsf@wirrsal.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000ff0d505715525f7" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fg3Nq-00008K-ET for emacs-orgmode@gnu.org; Thu, 19 Jul 2018 03:29:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fg3Np-0008MO-2e for emacs-orgmode@gnu.org; Thu, 19 Jul 2018 03:29:54 -0400 Received: from mail-oi0-x236.google.com ([2607:f8b0:4003:c06::236]:42285) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fg3No-0008Lu-PG for emacs-orgmode@gnu.org; Thu, 19 Jul 2018 03:29:52 -0400 Received: by mail-oi0-x236.google.com with SMTP id n84-v6so13713071oib.9 for ; Thu, 19 Jul 2018 00:29:52 -0700 (PDT) In-Reply-To: <87y3ea4abe.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 --0000000000000ff0d505715525f7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable My emacs is from homebrew without any manual settings on locale. I assume a number of locale settings come with it. I have not had any problems before this. OS X does not have LANG envvar set. This computer came with Finnish language set and I switched to English (Australian) for interface. This has lead to somewhat weird locale setting at OS: $ defaults read .GlobalPreferences AppleLanguages ( "en-FI" ) Apart from ssa, the output from string-collate-lessp seems to be what is to be expected: (string-collate-lessp "a" "x" "de_DE.utf-8" nil) ; t (string-collate-lessp "a" "X" "de_DE.utf-8" nil) ; nil (string-collate-lessp "=C3=9F" "ssa" "de_DE.utf-8") ; nil (string-lessp "=C3=9F" "ssa") ; nil (string-collate-lessp "=C3=A4" "=C3=B6" "fi_FI.utf-8") ; t (string-collate-lessp "=C3=84" "=C3=B6" "fi_FI.utf-8") ; t I can not able to comment on C code, but it really seems that alphabetic sorting is fixed to case-sensitive mode. -Heikki Heikki Lehv=C3=A4slaiho - skype:heikki_lehvaslaiho cell: +358 40 850 6640 http://about.me/heikki On 17 July 2018 at 09:59, Sebastian Reu=C3=9Fe wrote: > > Heikki Lehvaslaiho writes: > > > x86_64-apple-darwin14.5.0 > > Looking at the C source of =E2=80=98string-collate-lessp=E2=80=99 (src/fn= s.c), it looks > like there exists a case where Emacs itself will fall back on > =E2=80=98string-lessp=E2=80=99 even when =E2=80=98string-collate-lessp=E2= =80=99 is invoked. > > #else /* !__STDC_ISO_10646__, !WINDOWSNT */ > return Fstring_lessp (s1, s2); > #endif /* !__STDC_ISO_10646__, !WINDOWSNT */ > > I can=E2=80=99t tell what the first macro evaluates to on your platform. = Might > this be the cause? > > An indication for whether your Emacs uses the locale at all may be > testing the following (presuming you have the German locale data > installed and compiled): > > (string-collate-lessp "=C3=9F" "ssa" "de_DE.utf-8") ; t > (string-lessp "=C3=9F" "ssa") ; nil > > This is based on the German =E2=80=98=C3=9F=E2=80=99 ligature being sorte= d as if it were > equal to the string =E2=80=98ss=E2=80=99 (you can probably construct some= thing analogous > using fi_FI). If the first call returns nil, your Emacs isn=E2=80=99t usi= ng the > locale data at all. > > Kind regards, > SR > > -- > Insane cobra split the wood > Trader of the lowland breed > Call a jittney, drive away > In the slipstream we will stay > --0000000000000ff0d505715525f7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
My emacs is from homebrew without any manual settings on l= ocale. I assume a number of locale settings come with it. I have not had an= y problems before this.

OS X does not have LANG envvar s= et. This computer came with Finnish language set and I switched to English = (Australian) for interface. This has lead to somewhat weird locale setting = at OS:

$ defaults read .GlobalPreferences App= leLanguages
(
=C2=A0 =C2=A0 "en-FI"
)

Apart from ssa, the output from=C2=A0st= ring-collate-lessp seems to be what is to be expected:
(string-collate-lessp "a" "x" "de= _DE.utf-8" nil) ; t
(string-collate-lessp "a" &quo= t;X" "de_DE.utf-8" nil) ; nil
(string-collate-less= p "=C3=9F" "ssa" "de_DE.utf-8") ; nil
(string-lessp "=C3=9F" "ssa")=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0; nil
(string-collate-lessp "=C3=A4" "=C3=B6" "fi_FI.= utf-8") ; t
(string-collate-lessp "=C3=84" &qu= ot;=C3=B6" "fi_FI.utf-8") ; t

I can not able to comment on C code, but it really seems that alphabetic s= orting is fixed to case-sensitive mode.


=


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

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

On 17 July 2018 at 09:59, Sebastian Reu=C3= =9Fe <seb@wirrsal.net> wrote:
heik= ki.lehvaslaiho@gmail.com> writes:

> x86_64-apple-darwin14.5.0

Looking at the C source of =E2=80=98string-collate-lessp=E2=80=99 (src/fns.= c), it looks
like there exists a case where Emacs itself will fall back on
=E2=80=98string-lessp=E2=80=99 even when =E2=80=98string-collate-lessp=E2= =80=99 is invoked.

=C2=A0 =C2=A0 #else=C2=A0 /* !__STDC_ISO_10646__, !WINDOWSNT */
=C2=A0 =C2=A0 =C2=A0return Fstring_lessp (s1, s2);
=C2=A0 =C2=A0 #endif /* !__STDC_ISO_10646__, !WINDOWSNT */

I can=E2=80=99t tell what the first macro evaluates to on your platform. Mi= ght
this be the cause?

An indication for whether your Emacs uses the locale at all may be
testing the following (presuming you have the German locale data
installed and compiled):

=C2=A0 =C2=A0 (string-collate-lessp "=C3=9F" "ssa" &quo= t;de_DE.utf-8") ; t
=C2=A0 =C2=A0 (string-lessp "=C3=9F" "ssa")=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0; = nil

This is based on the German =E2=80=98=C3=9F=E2=80=99 ligature being sorted = as if it were
equal to the string =E2=80=98ss=E2=80=99 (you can probably construct someth= ing analogous
using fi_FI). If the first call returns nil, your Emacs isn=E2=80=99t using= the
locale data at all.

Kind regards,
SR

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

--0000000000000ff0d505715525f7--