From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YFPmC18uhGBpWgAAgWs5BA (envelope-from ) for ; Sat, 24 Apr 2021 16:42:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id ONyOB18uhGCCCwAA1q6Kng (envelope-from ) for ; Sat, 24 Apr 2021 14:42:39 +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 6D3C422D22 for ; Sat, 24 Apr 2021 16:42:38 +0200 (CEST) Received: from localhost ([::1]:52492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laJUT-0001Hk-9v for larch@yhetil.org; Sat, 24 Apr 2021 10:42:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laJU3-0001GD-Q5 for emacs-orgmode@gnu.org; Sat, 24 Apr 2021 10:42:11 -0400 Received: from ciao.gmane.io ([116.202.254.214]:34080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laJU1-00036P-Mn for emacs-orgmode@gnu.org; Sat, 24 Apr 2021 10:42:11 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1laJTy-00009x-Qx for emacs-orgmode@gnu.org; Sat, 24 Apr 2021 16:42:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Maxim Nikulin Subject: Re: [Patch] to correctly sort the items with emphasis marks in a list Date: Sat, 24 Apr 2021 21:41:55 +0700 Message-ID: <9b814221-fff4-320b-1eaf-ab2722282327@gmail.com> References: <87a6qg1rjx.fsf@posteo.net> <874kgft7n1.fsf@nicolasgoaziou.fr> <87blanxb1z.fsf@posteo.net> <87lf9fa3ak.fsf@posteo.net> <87sg3n8f33.fsf@posteo.net> <87tuo2d670.fsf@nicolasgoaziou.fr> <87r1j6b6ku.fsf@nicolasgoaziou.fr> <87a6pt9hyd.fsf@nicolasgoaziou.fr> <874kg0ae0k.fsf@nicolasgoaziou.fr> <87a6przlmy.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 In-Reply-To: <87a6przlmy.fsf@posteo.net> Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Nicolas Goaziou 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=1619275358; 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=+FApCPA5SSNWm9bxbY5eZL5nFCkV/d5gaUErhFFUrCg=; b=qoGoArcrrIUu52Rb6Tt3IlZoDFHo3Fhe9aE2QzGAebqKNGTurWiCAhAaEcc1CYWt4XcJ1f zYVb6B7d6VgdYzNQLbEqcIuKpt4lsjHFYkOf1A3+16bM294WHpGYP2goqjK9UvE5rsdpTR JgVTQ9wO5fH73W/ij/hc/U2fVy6juqb8DZ1TM5Ey7/vznN6YgI6PnuS5v67wNfPv9A6bae iO9P6gafqN+Sjn7PA8t4G3cmK0Mmx12wOjixbL1u3/55fWoMSqwftUOFBFRAVRW3cYrpdj ujrSKruTqRuszPbCBziaT4H+F09ThJjppvqETC5wf3Z224G4mwXNfGahJU/ejA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619275358; a=rsa-sha256; cv=none; b=OMGtpIf6LyKdm8Epn0w8SKqfTEMDUPimPU1ZoyAe4GU+SqnjgAkLW6eOQOvtXeSN2JziVF LhsBgcP9koIIzciv5bWWmykvWd7+KiFYUULJ4a6DOjswhCs7myJP0l6Gzdjc9poIO75Gic V2PTxYRoE35jbqhHOuTERp1Ctwv6mHIyaa2Emq8vA4RMX2bJgFGJ4BfSobXUqRUB/JyN+E IaQPBxhZjw4TlYXWS3bkoGXyA5Niw/V64HfTHj/1Bdyx2UNh16etIeaNEOsDzBzISUmNh5 /mU89OIxHaJjIy28dajIsK35zi7pl5J84tBfUqRshOjberf97Nz6W1jnbqI4Pg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=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: -1.84 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=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: 6D3C422D22 X-Spam-Score: -1.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: qjqRtuqX0nkT On 21/04/2021 22:45, Juan Manuel MacĂ­as wrote: > > I have tried the Nicolas' patch (latest version) and I see that the > items with emphasis are already ordered well. However, it seems that the > problem with identical items with or without emphasis still persists: > which items should go before and in what order? For example, in the > following list I get: > > - /a/ > - *a* > - a > - *b* > - /b/ > - b > - /v/ > - *v* > - v I am afraid, there is no easy way to take into account emphasis. Each item have to be split into logical units and locale-aware multilevel comparison should be applied to each unit separately. E.g. for description list, only term should be compared at first to properly order emphasized items, it does not matter if description starts from "a" or from "z". Simple `string-collate-lessp' for whole item uses further levels only strings are considered identical on previous levels. I had an idea to augment sort keys with some text properties for custom string comparator, but I decided that such complications would not ensure reliable sort for all possible cases. - A :: B - /A/ :: C - *A* :: A However `org-sort-remove invisible' still has some room for improvements (it is not mandatory in my opinion). I have realized it reading the thread on title representation for HTML export https://orgmode.org/list/87h7jy4ebe.fsf@nicolasgoaziou.fr/ - <>A - <<>> - B