From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +IUvByqse2OUMwAAbAwnHQ (envelope-from ) for ; Mon, 21 Nov 2022 17:49:46 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mN0jByqse2M67wAA9RJhRA (envelope-from ) for ; Mon, 21 Nov 2022 17:49:46 +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 B0B062DA0A for ; Mon, 21 Nov 2022 17:49:45 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ox9yR-0008M6-A2; Mon, 21 Nov 2022 11:48:47 -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 1ox9yM-0008G5-Jy for emacs-orgmode@gnu.org; Mon, 21 Nov 2022 11:48:42 -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 1ox9yK-00031z-W8 for emacs-orgmode@gnu.org; Mon, 21 Nov 2022 11:48:42 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1ox9yG-00031u-MF for emacs-orgmode@gnu.org; Mon, 21 Nov 2022 17:48:36 +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: Mon, 21 Nov 2022 23:48:27 +0700 Message-ID: References: <87ilkulwdy.fsf@localhost> <87y1tpejfm.fsf@localhost> <87wn7wdfis.fsf@localhost> <87pmdil0m0.fsf@localhost> <87k03pj8vw.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: <87k03pj8vw.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: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 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.191, 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=1669049386; 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=ygUlJh9ejfJELxNYFyAYFl+b7bD5QQBFALScuNMLqmc=; b=rueCT7dP3NsBwCpkZbALIkWib/1Mj/zvzpNARqIGDEF7MwxZxFx5CbhYBrgNWTctefQlXd i7B/awg35wNdLSjV+ntMoZ/b5N1aR6Fq0BuFoA/s27A9BLYyIqv+sFrkjMzHclGT/y/Ze6 Plh7mtJukf0yXw0wa7lOcuHhTOsu7NmifYgIDwAwwlSvPoFNHB46mXnzXKt/Se8tnyTLhT RT6A95h8O9hRVHTOIb8flUvjJpdhI+eH8BVKYKiPmZGzJ+vOAx9tFQw5rgCjTwq8a4MKiX U9KoO6aMgmS0MRfwQj4+dv59YRQV88zejkcln48budirHcs3l7CP9BNmSE2tog== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669049386; a=rsa-sha256; cv=none; b=cEioItWhzCCfJTZDrIZEUv5LMaun2tuwbgtlCf3H6bHsihMKl09S41o8+6hMleW3HjxHxZ pgrXEsgavppA2+ogn2Q41U8SV8U8aT6VNlAdkxi6eNnO0RtwyeaT8e8E8kFXAQsth1MvTG FVkaGSwM236Bpllt/1CGXhbbO5D41ZFPlPvsz3Wp/2OKwEs33Zln9UXTRH8A5E0/gyk4pS WUN8XgYuSnjzDvRd0WZIxUsq1/z1zUlj9UH82QOwjjdQd+h1JqdO/MByBVQVEI/w6olLO2 u6/HoQA+HOO2f/pRjm7eEdQygH5+jI/REu30QF12Tqy/WZV2Y3WuTXH8ck2XEQ== 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: 2.69 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: B0B062DA0A X-Spam-Score: 2.69 X-Migadu-Scanner: scn1.migadu.com X-TUID: r+yUA/+Hj6q0 On 21/11/2022 10:15, Ihor Radchenko wrote: > Max Nikulin writes: > >>> 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. > > Sounds reasonable. > > Note that not only `org-table-sort-lines' is using > `string-collate-lessp'. The full list of functions potentially affected > by libc sorting is: > > 1. Bibliography order in `org-cite-basic-export-bibliography' > (via org-cite-basic--sort-keys -> org-cite-basic--field-less-p) > 3. `org-table-sort-lines' Confirmed. > 2. `org-sort-list' > 5. `org-sort-entries' `downcase' is used, not proper case folding, so a potential issue > 4. `org-set-tags' (tag order), when `org-tags-sort-function' is set to > "Alphabetical" or "Reverse alphabetical". IGNORE-CASE argument is not used, perhaps `downcase' is hidden in the code. > 6. Agenda sorting, when alphabetical sorting is involved `string-lessp' and `downcase' so even more severe locale-related issues might be expected. > 7. `org-map-entries' Unsure which predicate is used. > I am not 100% sure where we should add the information to > docstring/manual and where we should not. If footnotes in the manual had fixed labels then I would suggest reference the same footnote in the manual and in the docstrings. Perhaps, a new subsection should be added to info "(org) Miscellaneous" and "see info node ..." should be added to all involved docstrings. >> 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. > > How can we check the availability? (string-collate-lessp "a" "B" "C" t) > Indeed. Also, see https://nullprogram.com/blog/2014/06/13/. However, > what we are concerned about here is consistency. Not the pitfalls per > se. Achieving consistency across Org code requires additional efforts.