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 OO6jAyI8fmOwAgAAbAwnHQ (envelope-from ) for ; Wed, 23 Nov 2022 16:28:34 +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 EPubAyI8fmMwhgEA9RJhRA (envelope-from ) for ; Wed, 23 Nov 2022 16:28:34 +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 BB2AD20D78 for ; Wed, 23 Nov 2022 16:28:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxrfI-00010n-17; Wed, 23 Nov 2022 10:27:56 -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 1oxrfG-00010P-58 for emacs-orgmode@gnu.org; Wed, 23 Nov 2022 10:27: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 1oxrfE-0008GV-F9 for emacs-orgmode@gnu.org; Wed, 23 Nov 2022 10:27:53 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oxrf8-00072w-VN for emacs-orgmode@gnu.org; Wed, 23 Nov 2022 16:27:46 +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: Wed, 23 Nov 2022 22:27:35 +0700 Message-ID: References: <87ilkulwdy.fsf@localhost> <87y1tpejfm.fsf@localhost> <87wn7wdfis.fsf@localhost> <87pmdil0m0.fsf@localhost> <87k03pj8vw.fsf@localhost> <87leo3dc42.fsf@localhost> <87k03mhs8b.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: <87k03mhs8b.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: 27 X-Spam_score: 2.7 X-Spam_bar: ++ X-Spam_report: (2.7 / 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.173, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=1669217313; 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=ywflBf2KeielAJ1w5qYLOdqjOGJNQFtesYtuzCBroDI=; b=dbxFU6HxSwvufaVQf8BQKDmljmKwDhp84VogRWJzJk5+AEq6jpzbqrkjP1efbaJ4KyGniP Bc7kn4/AlFfTuSjSqQPthT0qD1nMj+R5XWkJB7i5n0xyqCNIpkfZVeN90fZKzTPIFkGgbs sGRJUb663k5/6cQ8+I/dPvvpFrrC/0rUAZyNU8WUHNSjSr4DrqSdxozWmURvLBzXpya0qF t4O09GB6EszFn2nGOFdRRsZHGrrCV9sr+4Mu+wCLvf2O45VCivwDZVYzsTj7q0AWZAVGBd gMI6fhYZKKjzT8YQyR7hQsL4CU5f/WRwsfGgCiKVhS7hCCFBdVvpn3ymhnPBuQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669217313; a=rsa-sha256; cv=none; b=AnFCHx3Dq+dVc9NYAOxI8c2B0vWwKCqsdwx8wEb1ZMPEiQupXG3FbCmyU8ilVnxX6e9r00 zwDoaWqj+M/iH86FyIL/G8SCntG8T9e8OZ6pQXyRJWiF357Z+rRMCcbX8rafPUFiqHiExO rK5LstjwK59/ABNBq1Pm8ULND6a3eZ3ALR28D+Ee+hS7y0tw56946GrjYEQX6A1xGyCBPV B1ys0ugZ7pRMUV2D47iSNlUOdzu1frwKg8DZGKyy4pMrTzg6upSiqjYwOIMAJXT7x1CoEn 2lYkjyCmOoY+4QG7fiQxXU++JkQqu+dfUFAt4n/Y1Rib+feYjbq8m1zBL/6hqQ== 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.70 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: BB2AD20D78 X-Spam-Score: 2.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: RIFcDdtLFlCk On 23/11/2022 17:37, Ihor Radchenko wrote: > Max Nikulin writes: >> >> Strings to sort are passed either through `identity' or >> through `downcase'. > > Thanks for the pointer. > Now, I am getting more confused though. > Do we even need to use `string-collate-lessp' then? I think we do because sort result is presented to humans. (setq lst '("semana" "señor" "sepia")) (sort lst #'string-lessp) ; => ("semana" "sepia" "señor") (sort lst #'string-collate-lessp) ; => ("semana" "señor" "sepia") > Eli even argued that `string-collate-lessp' is strictly worse compared > to more predictable approach. See > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59275#40 In this particular case Eli may assume that e.g. list is a elisp structure, not a kind of text formatting. In general, I am quite pessimistic concerning quality of locales support in Emacs while Eli may have rather different point of view. > Do you remember any cases when users actually demanded locale-specific > sorting? I think, users too often face poor locale support in various applications, so they are not surprised when see incorrect results. In some sense such results are consistent (erroneous in the same way). Formatting of numbers in Emacs is the extreme case of consistency. For the sake of reliably reading/writing of numbers from/to files or network it is impossible to present a number accordingly to the current locale. An exception is en_US that has some dedicated code in calc. I believe, it is silly to adhere to a common denominator and to not use `string-collate-lessp' just because it is unavailable in some environments. > However, I feel a bit lost about what to do on Org side. > We can put a disclaimer in the manual and all that, but it still feels > too complex. My current suggestion is to provide a fallback to `downcase' in the code and to explain in the manual that runtime environments (OSes) are not equal and quality of locale support varies. Emacs heavily depends on libc in this area. >> However I am afraid of compatibility shims after >> >> d3a9c424b 2022-08-16 17:15:27 +0800 Ihor Radchenko: org-encode-time: >> Refactor into top-level `defmacro' > > What do you refer to? Implementation must be chosen at compile (or load) time. Due to some issues with native compiling it does not work. For string comparison runtime performance penalty may be higher than for timestamp processing. > The question is what can be done and, more importantly, how much effort > will it take to implement and maintain an alternative. Effort is significant however e.g. browsers have their own implementation of Unicode-related stuff. There is ICU library, but Eli is against it because Emacs already has partial implementation of Unicode and it would mean duplication of character database.