From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id oKNXHgMoOmbgVgAAqHPOHw:P1 (envelope-from ) for ; Tue, 07 May 2024 15:09:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id oKNXHgMoOmbgVgAAqHPOHw (envelope-from ) for ; Tue, 07 May 2024 15:09:23 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=rdvJoEwO; 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=1715087363; a=rsa-sha256; cv=none; b=i0Q1VTDCyu8LTbDEIYjJrWtulDd8cTWbbcCmL+YASTB4x/0oYe9TjTBi9yINuH/dt+DHuk 0EtDVXNv9nLaMLuzYzkNNrXKsMuQnqUCE/EoK5VtM54CmrYCbcwJ6B6VzqQrq/QEeoDy/h NR/PMeEK0olTy3qZYN0dvR5qNO/2HaWXewfK6he4U8YAnxCf0owOn/bzyRvlAmvUF3zdUN KI9lNHbaYTDsUMLb5RIbQM8QJYpnI+1WTtf4a8S9Gkj5s2KO/b00+WJ3g7bA+TA+458sLp vpfyQFItm15fvXFKr25zoZ6t1W20Su5N6A71e5j8EuqGb2lSLB1iMBIM5nJldw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=rdvJoEwO; 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=1715087363; 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=DqTdyDacoIeu2WXbZDCHjQ1b5LX0X8rW8VoBVcXum98=; b=ZA9UlLcqAWKjO3OIpdHCkyTo9boGyQWu8OMH4pPZVRZl9MHBTzm/YcXaZPYaWAjTBcELuM JqLJ256pAGZfGA2H1AaGRgG99PFGEKHzZvAvnPjo4ixSiW/wy1JtAfBDQR+rcu6ywmTkTG cP6otVr8kLDedYWtqWmMIu8ShSAEOXe9w4TRYv3RiRZ6uDyEGrp3rsjVSUZfHkx06mpSAb Ersot4vvdi8fL2jc1PimFwlM8B/2sUCxD2KoVWP9Qgzj5BrBOyUCmZ3qrCwOQD/CtnjmB4 O8yDFM+zdbE/javKdtoHNVbdg+I2GDy161a9NrLf3BlP5TCISAJLBnwK+lWsFw== 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 466A31F8F0 for ; Tue, 7 May 2024 15:09:23 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4KYe-00044n-H4; Tue, 07 May 2024 09:08:38 -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 1s4KYP-00040g-Gr for emacs-orgmode@gnu.org; Tue, 07 May 2024 09:08:28 -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 1s4KYJ-0000lS-0X for emacs-orgmode@gnu.org; Tue, 07 May 2024 09:08:19 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 6B50E240027 for ; Tue, 7 May 2024 15:08:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1715087282; bh=Fzg2djKPOc3jZFa8oKR3o7UO/a9xPU5Yg804bnafqr4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=rdvJoEwOztPNcvBOn+TdMqr8gMP/oLc2YRhaHmq9u1fSviON5uDR5f0sX7V8ZaAfo PHmecvy+7VYS/n27mT5gw9QBVCcGU6l6U74J4hR4OTFogqk6rEJOd4029EiiLlDbY0 EHGJvlrzi9LQ6L7EkUnTGSoQKfnHiHEPyoYsSUjP5Us4ozy2e7eNitYt7zRnPJq2a8 KK2AeYu4X5Q4u/Z5D2AFUS3j4vpTWmHbjQWxldvV6PePSBL6jrAp37YZLryJiUQ7nI GdqgsvOarLFgy/CWNyKVoQDgs7YUl5bjOPTIgkn7dodhUZ9bI0X/NixZhq/tzA+BZg wq0higtA6ezag== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VYdqj3gSHz9rxF; Tue, 7 May 2024 15:08:01 +0200 (CEST) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [DISCUSSION] Sorting strings in Org mode vs. system locale In-Reply-To: References: <87y1tpejfm.fsf@localhost> <87wn7wdfis.fsf@localhost> <87pmdil0m0.fsf@localhost> <87k03pj8vw.fsf@localhost> <87leo3dc42.fsf@localhost> <87k03mhs8b.fsf@localhost> <874jummpvy.fsf@localhost> <87jzleptcs.fsf@localhost> <87fruwtqo8.fsf@localhost> Date: Tue, 07 May 2024 13:09:23 +0000 Message-ID: <878r0lsr98.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 466A31F8F0 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -8.49 X-Spam-Score: -8.49 X-TUID: ZgRFITjax3tC Max Nikulin writes: > I consider the following as a kind of graceful degradation > > (defun org-sort-function-fallback-downcase > (a b &optional LOCALE IGNORE-CASE) > (if ignore-case > (string-collate-lessp (downcase a) (downcase b) locale ignore-case) > (string-collate-lessp a b locale ignore-case))) It is indeed better than `org-sort-function-downcase'. > (defcustom org-sort-function > (if (string-collate-lessp "a" "B" "C" t) > #'string-collate-lessp > #'org-sort-function-fallback-downcase)) No. Let's be consistent with Emacs here. > I would consider a setter function for `org-sort-function' to avoid > branches based of `func-arity' in `org-string<'. Setter is not reliable when setq is used, so I prefer arity check. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at