From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id cL4tIW5ADWYYYwEAe85BDQ:P1 (envelope-from ) for ; Wed, 03 Apr 2024 13:41:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id cL4tIW5ADWYYYwEAe85BDQ (envelope-from ) for ; Wed, 03 Apr 2024 13:41:34 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=m6bJLnll; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712144494; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=f/cJT1rHITdSZ+uiYJ984ILLfWt0VpUwd25tfBiLF8k=; b=LskRjwMKAtXBuc6k7lJaX4yVIQRmP0IbySUMy6SEW7J2GXLws3eAMhorEYIDRzDY4CIzWD 8j+YFWoLsKXazaP++8SlupAcC8n21s4wJnnzUTdoV0l4slnhbjR4Zb39UpAzTOniaDfzOS 6QhvrWsGhhl1U3bwkosKXDoI6wkSeQz0Rcby2/S+26ppV69ULGEnlWy0kMuKzjXKlh2Jcl EYVugbNdXjFvl1R8Vxai35b77Zeh35w1T9QsVjjLCxUVAi1VgXcvzk12QMWmfukiB5TCnq 1IT4rlwJ8MHG7oOC6vIAsdLqm4NWEjFdSBYZB/3UUtlitKcA1wG0HPN3kUinmA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=m6bJLnll; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712144494; a=rsa-sha256; cv=none; b=WGzYmcctd+Ou8tltz9hpNKbSXhD/sWv9DkN+Q1/9Kt0Y9UHUgumfZ0wzF1a8BJT3CTLL9V YJ3O+mNO3WBAIuEzeEG1hVGf84hTl2LSnPfOHNjAOr9HXSnRv5uPMu7m1BmtYKLtx28/Sq AyjqbAbu8Da5ZN7ZgR1HkD1hmNAnCZYcOTlMQVQoK10uZG5W9odjcXs0aS0BHG7P+xNcst hMAl1/m9FGtMgzi9d/7W3nkILq3FUK0zmaifXBYQF4bY69lx55s3SHivoRcCh3Mogs/Vmr Uar3ew5yrohwDZvN946dLIJCIy8RZZIC7v0mvYWzcWvWdz7KKX+Y2x0MP46AHg== 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 405CC646CE for ; Wed, 03 Apr 2024 13:41:34 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rryyh-0006lh-A8; Wed, 03 Apr 2024 07:40:27 -0400 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 1rryye-0006kk-Nc for emacs-orgmode@gnu.org; Wed, 03 Apr 2024 07:40:24 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rryyW-000275-AP for emacs-orgmode@gnu.org; Wed, 03 Apr 2024 07:40:24 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5F918240029 for ; Wed, 3 Apr 2024 13:40:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1712144413; bh=HhL8/VyjdU54R1zBgmQ6+touz7pSXqixdxZ8gtfR+Es=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=m6bJLnllAlayi31bfm/TIHPfIutQ8HthU1814Xr47NraiXf5d7NvUq/uxrbyl8W2n LPipYkK5qbzI6IjAzTXAEGfngG360hfsz79XigXRd9GHAOLo+5ZrCMhadVUGJctX8t pLjGRcvMO05OkBb8gvlBHOFoUDYdrYK0xh8IDf3z17oaap1ZR7EcjLT9OL5dxkZb+j O5XDoolZ7VdO0L8F9BQlNsrgjYxRMmhazbNTk6iHpmnlwtF+zdb72hBvgmrHuPAQsl /yve7VZ0pls3NZU2cmlRwmYlH2vmVTxcfFwPnmkmZwezNeZxodM5ovoPhqGs6WGwqn fxJ5R+5h3zvvQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V8jV430LDz6tyl; Wed, 3 Apr 2024 13:40:12 +0200 (CEST) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: [DISCUSSION] Sorting strings in Org mode vs. system locale (was: test-org-table/sort-lines: Failing test on macOS) In-Reply-To: References: <87ilkulwdy.fsf@localhost> <87y1tpejfm.fsf@localhost> <87wn7wdfis.fsf@localhost> <87pmdil0m0.fsf@localhost> <87k03pj8vw.fsf@localhost> <87leo3dc42.fsf@localhost> <87k03mhs8b.fsf@localhost> <874jummpvy.fsf@localhost> Date: Wed, 03 Apr 2024 11:40:19 +0000 Message-ID: <87jzleptcs.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 X-Migadu-Spam-Score: -6.64 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -6.64 X-Migadu-Queue-Id: 405CC646CE X-TUID: P8M9Onyhfnuo Max Nikulin writes: >> This sounds like something to be adapted to Emacs upstream. >> I suggested to change `string-collate-lessp' fallback behaviour to use >> `downcase' when IGNORE-CASE is non-nil. See my last message in >> bug#59275. > > I do not share Eli's position "all or nothing". I prefer graceful > degradation and best result achievable with reasonable efforts. > However either the reason is performance or correctness, both variants > are against modification of `string-collate-lessp'. I still think that > Org will benefit from a compatibility wrapper with `downcase'. Unless we have user complaints with real-world use-cases, I am leaning towards keeping things consistent with Emacs. Including Emacs-wide fallback for `string-collate-lessp'. This will make our life easier. Maintaining an Org-specific fallback will (1) cost maintenance time; (2) may confuse users used to global Emacs behaviour; (3) has no clear benefit other than our theoretical discussion. > The only additional consideration is that compare function should be > configurable. If a user access same files from Linux and macOS then it > may be really annoying to get different order of entries in agenda. For > most of Linux users it is better to use more smart > `string-collate-lessp'. Some care is required to sort entries obtained > from multiple buffers in predictable environment (locale, case > conversion table). I agree. We can introduce a new customization - `org-string-sort-function' that will be used across Org mode to sort user text. It would be even better to allow smart sort function that depends on document #+language, but I do not see an easy way to implement such feature - `string-collate-lessp' does accept LOCALE argument, but I have no idea how to link #+LANGUAGE to locale deterministically. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at