From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QH8ROeveeWNlGgEAbAwnHQ (envelope-from ) for ; Sun, 20 Nov 2022 09:01:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cHAtOOveeWOq+AAAG6o9tA (envelope-from ) for ; Sun, 20 Nov 2022 09:01:47 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A0079381CC for ; Sun, 20 Nov 2022 09:01:47 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owfGG-0001dM-R1; Sun, 20 Nov 2022 03:01:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owfFq-0001WH-KL for emacs-orgmode@gnu.org; Sun, 20 Nov 2022 03:00:54 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owfFp-0006oB-5U for emacs-orgmode@gnu.org; Sun, 20 Nov 2022 03:00:42 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1owfFj-0001CY-Ix for emacs-orgmode@gnu.org; Sun, 20 Nov 2022 09:00:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: test-org-table/sort-lines: Failing test on macOS Date: Sun, 20 Nov 2022 15:00:28 +0700 Message-ID: References: <87ilkulwdy.fsf@localhost> <87y1tpejfm.fsf@localhost> <87wn7wdfis.fsf@localhost> <87pmdil0m0.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US In-Reply-To: <87pmdil0m0.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 26 X-Spam_score: 2.6 X-Spam_bar: ++ X-Spam_report: (2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1668931307; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7f6ZLuYSAwTUHRoZjk05bGIkLR4Bx/2aeEmTh36PK4c=; b=F4J14O1S9rzCTbHg0248ERkSaKtZvulBlDXUc3uLKKwBfHNXp6l4/VECx7HQoW6Ajj9BZg euvwL4IYH2sZxXWV0lplni1HEnDVYxSZDbrJooTRUvQVeEnauKA1Ts8u2f/4opz575zO14 31fGatZ8l0PxhhyR4i3IAHxNaErDyqeVKQ+y9mxnYDrZefIc5KiUufVatXAHUztwzPQA07 HVfqPU38f+wtyuDlH0SH6qLansi8f8rX/njJy6NH9UtkYx7qKBQ/7wCzcI/ZeW8/GreOQq /IkxjARCdpkiiLBQoIJOWzcWpmQdJba45YaAbVfK8jimlfkOHACYOoLBYwSVUA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668931307; a=rsa-sha256; cv=none; b=UjwTc0qenUwqnySMLaNWzrQGt8zUcjlLMlDzG80rCvjo+0BdffdBEyriZepZ/MxqlvTVt9 o8QsQl/llo4ha5B7zmciJrUUJ2UJuTKRmQaJ3RvlcmOyrzJHvcvnEeIcf8b0vInvAD3JlS cAAMjR/WM5RZ2i+om+DVaIASsujh1PIbVnj8FYg1HUG0IWlQgDdoPdIZBQl6lfSEC92nmc rALESevEsHh5Is56ftjqouE0gTVDFr+1/zBkNCbv22R1uU5r6FequtRaOMKMaZpNqYJxTZ tpQ+OVNcg39lUQLaTsAib+L2gRttpFZXKpxStGLDlGcwVtzPY9y06V+9gkSQ4Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 1.89 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A0079381CC X-Spam-Score: 1.89 X-Migadu-Scanner: scn0.migadu.com X-TUID: b/OGu8DqAXRJ On 20/11/2022 11:18, Ihor Radchenko wrote: >> Max Nikulin writes: >>> From my point of view it is a reason to file an Emacs bug because I get >>> >>> (string-collate-lessp "a" "B" "C" t) ; => t >> >> See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59275 > > According to the discussion on debbugs, it looks like we can use > `compare-strings' instead. It will be independent of the system locale > and always follow Unicode rules. > > However, I am not sure if ignoring locale is something we really want. > WDYT? I think we should keep `string-collate-lessp' in the `org-table-sort-lines' implementation. Users expect sorting accordingly to their locales. However it is better to add a warning to `org-table-sort-lines' docstring and to the manual that caseless sort depends on its implementation in libc, so currently it does not work in clang/llvm and so e.g. on MacOS. Concerning the test, I would split the current testcase into 2 parts depending on WITH-CASE argument, check if caseless collation is available and skip the related test otherwise. As to the thread linked to the bug report https://lists.gnu.org/archive/html/emacs-devel/2022-07/msg00940.html "case-insensitive string comparison." Tue, 19 Jul 2022 13:27:50 -0400, there is a link https://stackoverflow.com/questions/319426/how-do-i-do-a-case-insensitive-string-comparison unrelated to the issue, but comments and answers there describe a lot of pitfalls and explain why string comparison ignoring case is not trivial. (It is a Sisyphean task in some sense, I like the comment on 3 sigmas.)