From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sPgPBouEeGDRCwAAgWs5BA (envelope-from ) for ; Thu, 15 Apr 2021 20:23:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EE1iO4qEeGDHFAAAB5/wlQ (envelope-from ) for ; Thu, 15 Apr 2021 18:23:06 +0000 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 698F9901E for ; Thu, 15 Apr 2021 20:23:06 +0200 (CEST) Received: from localhost ([::1]:45822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX6dt-0008LY-GF for larch@yhetil.org; Thu, 15 Apr 2021 14:23:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX6ch-0008J0-Ku for emacs-orgmode@gnu.org; Thu, 15 Apr 2021 14:21:53 -0400 Received: from mout02.posteo.de ([185.67.36.66]:42935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX6cd-0008SV-De for emacs-orgmode@gnu.org; Thu, 15 Apr 2021 14:21:51 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 1E738240109 for ; Thu, 15 Apr 2021 20:21:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1618510901; bh=3qCmMVxYVV/CM4V08ihKYMVHmwpvaVXfZ7gY9O9ZfA8=; h=From:To:Cc:Subject:Date:From; b=FIIXepWa/3TqvKxYX0HPpxsOfdRJjvGRozXNHnY4AaDu1vgmmPRsadxEatjt60DwY iGm/6RG8vMBGvrgWcWDVUk4IN9CAnYUkvmVJzhJvslXxsdiopLKQRYu3yOL++X7Rz3 7skMde2Zd2c0tlzXDgTOyCkMzL2aZcYV9zz12SRD1IDs7IZFYMpDXJZijdEoBbP/54 u5eq1m2LPaTFj7LZA7u7h94Xc/xaujOKD6VdZlqyF9tw4Mo1qzxXWDGMYRUGyowYyb t3wFP/P213Cc8135XGmSV5rCo8x3jER5tuAUiplYD8lEryxlYlpqgCC7fLjaqywcBc TTFvxXhVVFq1w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FLnjc2pBTz6tmj; Thu, 15 Apr 2021 20:21:40 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Maxim Nikulin Subject: Re: [Patch] to correctly sort the items with emphasis marks in a list References: <87a6qg1rjx.fsf@posteo.net> <874kgft7n1.fsf@nicolasgoaziou.fr> <87blanxb1z.fsf@posteo.net> <87v98usaqt.fsf@nicolasgoaziou.fr> <87pmz29xjf.fsf@posteo.net> <877dl6atpj.fsf@posteo.net> <87y2dkrdzl.fsf@posteo.net> Date: Thu, 15 Apr 2021 18:21:38 +0000 In-Reply-To: (Maxim Nikulin's message of "Thu, 15 Apr 2021 21:58:23 +0700") Message-ID: <87fszrwgr1.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=maciaschain@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618510986; 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=ChlgCwNikC1tOGLvLOOEo/edklNYg7dMvDkyuE8CP7o=; b=F1QxsJcDzqfBUQ3g1ARjAjz/V2HpE15Tx4vHPtDuDSD2Ipj8O/+SiU8+vnBMR4Nvg0K2sv 2eFP1W6XFWp843FhncRXnf/fghEBAPbOzQTpbnlfnV7RLL+IiwAaVq51VnUryN0oIvP9ti sIxw2xmlC8i/RUBWAqxmyahGgTlPF2+ITHTkXt+bjVmwFBh4+Vq4ORkSRXxxyx6mfgqhWH F84Mw4nnLH6O+5m2dSO6oQDhTV01pDBAc9qDiuPjLz6GmHcokcJQXr++/JnS4Xoup8xxPB 21Gx7982fD0jCNpF5SKhLGTjIN9vJLVsMh83l4x5hR+eeCO+SO/QMShs6jbrdQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618510986; a=rsa-sha256; cv=none; b=n7tlPpdjLgRAS0Y20jM1w2h59Y74Q0iKdaq7q4sTG/xZLggE1qw7mTtCeHosPKmFD3vvhp YkdfW7hpv/+TbuHszo7Ms19JjwkcJUGumEOcFhR+YOxHHE3Aavc1AyRSHO8ICHCPP9nrQx 0qBwZTY2+f0Nh1lRaVeETHP3J9HvnCQZPjNVUGjz/ZcP0sPuIumZYdk6VaD4w8H2U+dIxW JwXJJhjdiO+oXlFDxUvmcTMvtMhy3y8PtubucNmeP94vdnz1HfaXE9KsmxlhJIVoalbjIu U7rHsZnVD5Q77A73F7J2yi/y7BuCQcLECO5eTxgSI+ejnnxtcdGIjLKAseLVmA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=FIIXepWa; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=FIIXepWa; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 698F9901E X-Spam-Score: -3.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: RTvkPiGdEejR Hi Maxim Maxim Nikulin writes: > I can reproduce the issue with emacs-27.1 from ubuntu-21.04 beta live > image running in qemu. Org mode is current git HEAD. It seems that > something is changed in emacs since locale is correct: > > ubuntu@ubuntu:~$ printf '%s- v\n- /v/\n- a\n- /a/\n' '' \ > | LANG=C.UTF-8 sort > - /a/ > - /v/ > - a > - v > ubuntu@ubuntu:~$ printf '%s- v\n- /v/\n- a\n- /a/\n' '' \ > | LANG=es_ES.UTF-8 sort > - /a/ > - a > - /v/ > - v > > Concerning org-sort-list, I do not see any problem with en_US.UTF-8, > it_IT.UTF-8, and ru_RU.UTF-8 locales. However emphasized items are > sorted first for at least es_ES.UTF-8, es_MX.UTF-8, and es_US.UTF-8. > I have found some evidence that the problem is on the org side > > cat list.el > (message "%S" (sort '("- /v/" "- v" "- a" "- /a/") > #'string-collate-lessp)) > > LC_ALL=C.UTF-8 emacs --batch -Q -l list.el > ("- /a/" "- /v/" "- a" "- v") > > LC_ALL=en_US.UTF-8 emacs --batch -Q -l list.el > ("- /a/" "- a" "- /v/" "- v") > > LC_ALL=es_ES.UTF-8 emacs --batch -Q -l list.el > ("- /a/" "- a" "- /v/" "- v") > > So even string-collate-lessp works as expected. > > I'm puzzled why the problem is specific to org-sort-list and namely to > Spanish locales. > > Well that's pretty weird ... I wonder if the (spurious?) spaces in `org-sort-remove-invisible' that I mentioned at the beginning may be helpful to keep a track, or if it's just something that masks the problem. Anyway, I have noticed that the only space that seems determinant (from some way that escapes me) is this (where I put the @ sign): org-emph-re (lambda (m) (format "@%s " (match-string 4 m))) Following your examples, it occurred to me to try this, which I don't know if it is relevant or if I have entered a dead end: #+begin_src emacs-lisp :tangle list-var.el (message "%S" (sort '("-\s\sv" "-\sv" "-\sa" "-\s\sa") #'string-collate-lessp)) #+end_src #+begin_src sh exec 2>&1 LC_ALL=en_US.UTF-8 emacs --batch -Q -l list-var.el #+end_src #+RESULTS: : - a" "- a" "- v" "- v #+begin_src sh exec 2>&1 LC_ALL=es_ES.UTF-8 emacs --batch -Q -l list-var.el #+end_src #+RESULTS: : - a" "- v" "- a" "- v Best regards, Juan Manuel