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: Tue, 15 Nov 2022 17:16:14 +0200 Message-ID: <837czwi6yp.fsf@gnu.org> References: <87zgcsdfma.fsf@localhost> <83iljgib4w.fsf@gnu.org> <87h6z0cl6b.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28003"; 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 Tue Nov 15 16:17:37 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 1ouxgu-0006ze-Nm for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Nov 2022 16:17:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ouxgT-0006MC-L2; Tue, 15 Nov 2022 10:17:09 -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 1ouxgN-0006IR-DT for bug-gnu-emacs@gnu.org; Tue, 15 Nov 2022 10:17:05 -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 1ouxgM-0005LS-Pj for bug-gnu-emacs@gnu.org; Tue, 15 Nov 2022 10:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ouxgM-0005hy-Ba for bug-gnu-emacs@gnu.org; Tue, 15 Nov 2022 10:17: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: Tue, 15 Nov 2022 15:17: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.166852537021869 (code B ref 59275); Tue, 15 Nov 2022 15:17:02 +0000 Original-Received: (at 59275) by debbugs.gnu.org; 15 Nov 2022 15:16:10 +0000 Original-Received: from localhost ([127.0.0.1]:55070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouxfV-0005gf-RR for submit@debbugs.gnu.org; Tue, 15 Nov 2022 10:16:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouxfS-0005fr-BW for 59275@debbugs.gnu.org; Tue, 15 Nov 2022 10:16:08 -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 1ouxfM-00057K-Tg; Tue, 15 Nov 2022 10:16:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Cp73UlZW43tXFrVb19JHIpdCK3psV5olNS3/CEIgWF8=; b=alXIB8JR6NAYvikHnckw cus54x9o4afwcHOqcSImcXB02xqo3awSm+FERce/jltW9Zxyd3HGPpxaw4J5V7KlMwWMIXctqgJJg 7zfTrR0vm1I9KHx02WFalUeLoPUeYAvLLbGmlvisSCeKl+yCwWU3MjcUlt5WuXKYTtnTgGHjiz94z 37zJ7Fj8Bi+6IOm8cSiKjYU8U7SPi6vUuk8qG5X9R67yuw7dQDrPikC4jAtbUx9Y30C9AAZH5ItCg /pkkFyv1MLs6KHghahZp09/X3g1F+N5oZNKv76DKuzO8+ldvJfon1cyyDYsrLhLlqNs4tnkU2BrpP gfgl4mEbu0CRKg==; 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 1ouxfM-0008O0-Cz; Tue, 15 Nov 2022 10:16:00 -0500 In-Reply-To: <87h6z0cl6b.fsf@localhost> (message from Ihor Radchenko on Tue, 15 Nov 2022 15:05:48 +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:247956 Archived-At: > From: Ihor Radchenko > Cc: 59275@debbugs.gnu.org > Date: Tue, 15 Nov 2022 15:05:48 +0000 > > Eli Zaretskii writes: > > > string-collate-lessp is inherently platform- (and locale-) dependent. > > Don't use it if you want consistent results across platforms and > > locales. > > Is there a better alternative? Alternative to do what job? > Also, do I miss something, or is this pitfall not documented in the > docstring of `string-collate-lessp'? It isn't? then what is this about: This function obeys the conventions for collation order in your locale settings. For example, punctuation and whitespace characters might be considered less significant for sorting: (sort '("11" "12" "1 1" "1 2" "1.1" "1.2") 'string-collate-lessp) => ("11" "1 1" "1.1" "12" "1 2" "1.2") [...] To emulate Unicode-compliant collation on MS-Windows systems, bind ‘w32-collate-ignore-punctuation’ to a non-nil value, since the codeset part of the locale cannot be "UTF-8" on MS-Windows. The ELisp manual says in addition: This behavior is system-dependent; e.g., punctuation and whitespace are never ignored on Cygwin, regardless of locale. If this doesn't have a big WARNING sign near it, then what would?