From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59275: Unexpected return value of `string-collate-lessp' on Mac Date: Mon, 21 Nov 2022 15:31:38 +0200 Message-ID: <8335ac4eo5.fsf@gnu.org> References: <87zgcsdfma.fsf@localhost> <83iljgib4w.fsf@gnu.org> <87h6z0cl6b.fsf@localhost> <837czwi6yp.fsf@gnu.org> <8735ajel7y.fsf@localhost> <83mt8rgill.fsf@gnu.org> <877czokbpk.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1644"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59275@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 21 14:38:33 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ox70K-0000Bv-JP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Nov 2022 14:38:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ox6u5-00044G-0F; Mon, 21 Nov 2022 08:32:05 -0500 Original-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 1ox6u2-00040s-IM for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 08:32:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ox6u2-00069Y-9M for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 08:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ox6u2-0000fs-2M for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 08:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Nov 2022 13:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59275 X-GNU-PR-Package: emacs Original-Received: via spool by 59275-submit@debbugs.gnu.org id=B59275.16690374972559 (code B ref 59275); Mon, 21 Nov 2022 13:32:02 +0000 Original-Received: (at 59275) by debbugs.gnu.org; 21 Nov 2022 13:31:37 +0000 Original-Received: from localhost ([127.0.0.1]:45783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ox6tc-0000fD-TQ for submit@debbugs.gnu.org; Mon, 21 Nov 2022 08:31:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ox6tZ-0000ey-BI for 59275@debbugs.gnu.org; Mon, 21 Nov 2022 08:31:36 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox6tT-0005zg-Ky; Mon, 21 Nov 2022 08:31:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=sB1pkd1rAr1XueDezPqLN9c/sFhNQp3L4vToGsSgIps=; b=p4VLKCBN7byq 24L0V52Z6cGYrE1MVyz3dZW7TWpJqR3Xeh9n4juZYVolik8tnchtS57LxXPLmZ5GkNjPeGOujp5tP /RJtTS/12BfNUzLdKJRID4qZM1o4J8shlphKyd1PRptbMmy7u0knHJPooy0tQSODh9KmFnP3I72Lo cAqQP2pJmgh+bzCMb8tO0OfOQ+HZpdng5DlNNoVzKXCtTIOmjPZz33yMhfXkxfMTWRjk7O6E5dWB0 sv9yk0pqD6gJ4a/Rupj2bYMSeTHbGSFPdPqu/mSav67Qz8wlqEgbzVDMvvVEl1zSJmAm3b21NHimT 5u99a5nfo3eSOTBAf5M9pg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox6tT-0003Ga-4G; Mon, 21 Nov 2022 08:31:27 -0500 In-Reply-To: <877czokbpk.fsf@localhost> (message from Ihor Radchenko on Mon, 21 Nov 2022 07:28:55 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248527 Archived-At: > From: Ihor Radchenko > Cc: 59275@debbugs.gnu.org > Date: Mon, 21 Nov 2022 07:28:55 +0000 > > Eli Zaretskii writes: > > >> Reliable sorting. > >> In particular, I am looking for a better PREDICATE argument for > >> `sort-subr' for case-sensitive and case-insensitive sorting of strings. > > > > In the strict order of Unicode codepoints? Use compare-strings. > > Thanks for the clarification. > After further considerations, it looks like we should still use > `string-collate-lessp' on Org side as it yields expected results if libc > properly implements the collation. Is the feature that uses it intended to be used only on glibc platforms (which basically means GNU/Linux)? If not, I'm surprised that you arrived at this conclusion. It is the 180 deg opposite of what I think you should have decided. Once again: locale-specific collation order is inherently unpredictable in its results, and should only be used when the locale-specific order is a _must_, like when sorting people's names for a telephone directory. > Maybe change > > If your system does not support a locale environment, this function > behaves like `string-lessp'. > > to > > Some operating systems do not implement correct collation (in specific > locale environments or at all). Then, this functions falls back to > case-sensitive `string-lessp' and IGNORE-CASE argument is ignored. Fine with me.