From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +CFjD5JAfWBNNQAAgWs5BA (envelope-from ) for ; Mon, 19 Apr 2021 10:34:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id ILQqC5JAfWDzPAAA1q6Kng (envelope-from ) for ; Mon, 19 Apr 2021 08:34:26 +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 8D2C12DE6F for ; Mon, 19 Apr 2021 10:34:24 +0200 (CEST) Received: from localhost ([::1]:45520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYPMM-0002iT-3k for larch@yhetil.org; Mon, 19 Apr 2021 04:34:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYPLo-0002iF-Tb for emacs-orgmode@gnu.org; Mon, 19 Apr 2021 04:33:50 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:38121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYPLl-0004SQ-K6 for emacs-orgmode@gnu.org; Mon, 19 Apr 2021 04:33:48 -0400 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 7AA19100010; Mon, 19 Apr 2021 08:33:41 +0000 (UTC) From: Nicolas Goaziou To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= 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> <87lf9fa3ak.fsf@posteo.net> <87sg3n8f33.fsf@posteo.net> Mail-Followup-To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= , orgmode Date: Mon, 19 Apr 2021 10:33:39 +0200 In-Reply-To: <87sg3n8f33.fsf@posteo.net> ("Juan Manuel =?utf-8?Q?Mac=C3=AD?= =?utf-8?Q?as=22's?= message of "Sun, 18 Apr 2021 21:20:32 +0000") Message-ID: <87tuo2d670.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=217.70.178.231; envelope-from=mail@nicolasgoaziou.fr; helo=relay11.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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=1618821264; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3IUkvSrxvX19i2haBiPUWo6dlmaeVErJxiN6/WzBf2g=; b=moR5Q6f+9tNRmmrOHmU89domKOw0psx5lQ+gg0K9p1Thiw+/7X60/RUkngJU97Fe0X98yA L2zbuofF/Axn/xYmHKcovpxClXEj5lQy0VCJMSOi6l3x5ajqvB12vwsrHm7Vmd1y7WAlNb dKeFxEyy5+WFsBicdKszMiwwUCMzDj/msswWdtlOMsEF2qid6bIFOd2/UyOoD1GmM2TIlS gJFiBbl6fyPZuAfzvnMki1xO/YX/JMlOEVo1rJFqNPSjMKFGJask/qXYDVpfeU6UsQvh/1 M9R2AlOxMoGDBM2TNitf0Kz8xNb/eYiKTN6+ID4miwRkLSB2pS9WwghVefdIag== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618821264; a=rsa-sha256; cv=none; b=Vk7gavyK7UBiaBp28zTUH39g32dTDgdc5u8S2toIDnRu38R1IBtKFun9MjunfweJnv03E9 mcXcb1sU3y2+URCNrCHcnp2zAg6t6GTqpSpJFUau+iAcD/K+VN4b/r/f4DUCo+Hznv8vVL OJtdzEBIOAWMSBG2GOIBlfF6xfGxOQUhRz1pDNdsq0NxG2eQixTq8+92MZ6LHdKWnV1Ngm ZTO2a/NajC20LQnYWxP0MPz0xnIDKYwtJuIlpWpkRAXDQCee/T7/OTlZHvA2Z1gYzVpazc kT+DIYrvSqZPAKQqVrxnYA49R/eVef5MV8R5RFPd72lIQgfcDZFb9Ryo6nxFFw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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: -2.44 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: 8D2C12DE6F X-Spam-Score: -2.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: /rZTYUONBkwb Hello, Juan Manuel Mac=C3=ADas writes: > I wonder if this other approach can be viable or if it is something > crazy: if the spaces in org-sort-remove-invisible are a > problem only for the first emphasis of each item, how about this > fix to org-sort-list? (not modifying org-sort-remove-invisible): I think `org-sort-remove-invisible' is wrong, so it is the one that needs to be fixed. Could you try the following instead? --8<---------------cut here---------------start------------->8--- (defun org-sort-remove-invisible (s) "Remove invisible part of links and emphasis markers from string S." (let ((remove-markers (lambda (m) (concat (match-string 1 m) (match-string 4 m) (match-string 5 m))))) (remove-text-properties 0 (length s) org-rm-props s) (replace-regexp-in-string org-verbatim-re remove-markers (replace-regexp-in-string org-emph-re remove-markers (org-link-display= -format s) t tt) t t))) --8<---------------cut here---------------end--------------->8--- Regards, -- Nicolas Goaziou