all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Max Nikulin <manikulin@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: test-org-table/sort-lines: Failing test on macOS
Date: Sat, 08 Oct 2022 13:25:29 +0800	[thread overview]
Message-ID: <87ilkulwdy.fsf@localhost> (raw)
In-Reply-To: <thp4k4$t7i$1@ciao.gmane.io>

Max Nikulin <manikulin@gmail.com> writes:

> On 07/10/2022 03:15, Rudolf Adamkovič wrote:
>> 
>> If I understand, "a" should be less than "B" when under "C" locale when
>> ignoring case (nil) , right?  Yet, I get the following:
>> 
>> (string-collate-lessp "a" "B" "C" nil)  ; => nil
>
> When case is not ignored (4th argument is nil) locale-dependent 
> collation rules are used, so you get the expected result.
>
> $ printf 'a\nB\n' | LC_COLLATE=C sort
> B
> a
> $ printf 'a\nB\n' | LC_COLLATE=en_US.UTF-8 sort
> a
> B

Should we then modify the test to set locale explicitly?

>> [FYI: If I replace nil with t, the procedure returns nil too.]
>> 
>> Tested on Emacs 29 (adaa2fc90e) and Org 9.5.5 (580f28614).
>
> Strange. Emacs-26, Linux
>
> (string-collate-lessp "a" "B" "C" t)
> t
>
> If libc is sane (assuming that sort is linked to the same libc)
>
> printf 'a\nb\n' | LC_COLLATE=C sort
> printf 'b\na\n' | LC_COLLATE=C sort
> printf 'A\nB\n' | LC_COLLATE=C sort
> printf 'B\nA\n' | LC_COLLATE=C sort
> printf 'a\nb\n' | LC_COLLATE=C.UTF-8 sort
> printf 'b\na\n' | LC_COLLATE=C.UTF-8 sort
> printf 'A\nB\n' | LC_COLLATE=C.UTF-8 sort
> printf 'B\nA\n' | LC_COLLATE=C.UTF-8 sort
>
> then you might face an Emacs bug.

IDK if it is related, but there was a recent (fixed) bug in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55787

Note that Rudolf is using Emacs 29.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2022-10-08  5:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 20:15 test-org-table/sort-lines: Failing test on macOS Rudolf Adamkovič
2022-10-07 12:04 ` Max Nikulin
2022-10-08  5:25   ` Ihor Radchenko [this message]
2022-10-08 14:27     ` Max Nikulin
2022-10-09  3:59       ` Ihor Radchenko
2022-10-09 15:38         ` Rudolf Adamkovič
2022-10-09 16:53           ` Max Nikulin
2022-10-10 22:25             ` Rudolf Adamkovič
2022-10-12 16:09               ` Max Nikulin
2022-11-15  4:10                 ` Ihor Radchenko
2022-11-20  4:18                   ` Ihor Radchenko
2022-11-20  8:00                     ` Max Nikulin
2022-11-21  3:15                       ` Ihor Radchenko
2022-11-21 16:48                         ` Max Nikulin
2022-11-22  1:14                           ` Ihor Radchenko
2022-11-22 16:01                             ` Max Nikulin
2022-11-23 10:37                               ` Ihor Radchenko
2022-11-23 15:27                                 ` Max Nikulin
2022-11-23 17:01                                   ` Max Nikulin
2022-11-26  2:05                                   ` Ihor Radchenko
2022-11-29 16:40                                     ` Max Nikulin
2024-04-03 11:40                                       ` [DISCUSSION] Sorting strings in Org mode vs. system locale (was: test-org-table/sort-lines: Failing test on macOS) Ihor Radchenko
2024-05-05 11:59                                         ` Ihor Radchenko
2024-05-07 11:06                                           ` [DISCUSSION] Sorting strings in Org mode vs. system locale Max Nikulin
2024-05-07 13:09                                             ` Ihor Radchenko
2024-05-07 16:47                                               ` Max Nikulin
2024-05-11  9:38                                                 ` Ihor Radchenko

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

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

  git send-email \
    --in-reply-to=87ilkulwdy.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.