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: Sun, 27 Nov 2022 16:23:50 +0200 Message-ID: <83mt8cpjbd.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> <8335ac4eo5.fsf@gnu.org> <87ilj7dbms.fsf@localhost> <83sfib172p.fsf@gnu.org> <877czimpz4.fsf@localhost> <83r0xqta0d.fsf@gnu.org> <87v8n2je5q.fsf@localhost> <83k03it6i2.fsf@gnu.org> <2ed46071-5cd1-67ca-bd95-1c2a3060807d@gmail.com> 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="3630"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, 59275@debbugs.gnu.org To: Maxim Nikulin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 27 15:24:12 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 1ozIZo-0000iu-Gr for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Nov 2022 15:24:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozIZg-0007UV-Lv; Sun, 27 Nov 2022 09:24:04 -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 1ozIZf-0007UN-M5 for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 09:24:03 -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 1ozIZf-0004Hd-Dm for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 09:24:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozIZe-0005FV-9r for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 09:24: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: Sun, 27 Nov 2022 14:24: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.166955901320170 (code B ref 59275); Sun, 27 Nov 2022 14:24:02 +0000 Original-Received: (at 59275) by debbugs.gnu.org; 27 Nov 2022 14:23:33 +0000 Original-Received: from localhost ([127.0.0.1]:42350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozIZA-0005FG-S4 for submit@debbugs.gnu.org; Sun, 27 Nov 2022 09:23:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozIZ8-0005F9-WB for 59275@debbugs.gnu.org; Sun, 27 Nov 2022 09:23:31 -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 1ozIZ2-0004EX-Uo; Sun, 27 Nov 2022 09:23:25 -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=Vo28Vtg2+6jJc4kWNwM6JlmUEJI+sTgJsk8NQmDZ5Po=; b=Jm8d6D4BTyN7qZMjSN6h Vc3KddJYs0kas2Bu8s4k2euoArP7I7jIxJZqJgcUlHUbIsTzeozTrLxgscI0LHELBv9ipH5kVYOur pvlXf3cOwi6MTojk2KjUcL4XczEEmcShNlZalVadr/g+pawpcDkhT/HNMCa0pjbPlrw05+RgK4k/g IRv/TcXWdzX9bpf3Tn/zGnMuNWVurEw+cpdI7QbWyeGgo+Wh3aLPK2l9MwB67Kfp5hiv+D8YzerXQ iZHZQhX8h2PJvpsvTezkixorXlRHcurgjrT0AFjWMCHozgQd/obkgBzXfU2DjrCxOz5egYpDq6sgT kSxzAv6Uzm9Yfw==; 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 1ozIZ1-0006mw-Dz; Sun, 27 Nov 2022 09:23:23 -0500 In-Reply-To: <2ed46071-5cd1-67ca-bd95-1c2a3060807d@gmail.com> (message from Maxim Nikulin on Sun, 27 Nov 2022 21:00:50 +0700) 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:249221 Archived-At: > From: Maxim Nikulin > Date: Sun, 27 Nov 2022 21:00:50 +0700 > Cc: 59275@debbugs.gnu.org > > Concerning Org, my point is that caseless sorting should be uniform. You need to work hard to get that. Just using 'downcase' is not enough, and neither is using 'string-collate-equalp'. > >> https://nullprogram.com/blog/2014/06/13/ that mentioned something > >> similar about caveats with composition. > > > > I don't see there anything about sorting or collation. What did I miss? > > Does not composed/decomposed representation affect comparison result? They are different texts, so yes, they do, and they should. If you want to treat such strings as equivalent, you need to work even harder, since Emacs currently doesn't have enough infrastructure to do it right in all cases. > > Emacs-devel thread mentioned earlier in this bug contains a link > describing enough issues with string comparison: > > https://stackoverflow.com/questions/319426/how-do-i-do-a-case-insensitive-string-comparison This is about Python, no? > From my point of view e.g. case transformation rule for Turkish I is a > minor issue Why, Org doesn't want to support Turkish users? > My argument against `downcase' in `string-collate-lessp' is that it may > add noticeable performance penalty. I'd worry about correctness before performance. > Interestingly `compare-strings' uses upcase conversion when the > IGNORE-CASE argument is true. I believed that some implementations > (unrelated to Emacs) may have problems with e.g. ß and considered > downcase as a safer option. Case conversions always have problems.