emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] to correctly sort the items with emphasis marks in a list


From: Maxim Nikulin
Subject: Re: [Patch] to correctly sort the items with emphasis marks in a list
Date: Wed, 21 Apr 2021 20:10:50 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 21/04/2021 03:37, Nicolas Goaziou wrote:
Maxim Nikulin writes:

(let ((s (org-sort-remove-invisible
"A wrapping [[https://orgmode.org?a=b&c=d#e][link]] emphasis/"

I expect "A wrapping link emphasis".

Yet, your expectations are wrong. There is no link in the text above.
Emphasized text starts at "/wrapping" and ends before "/?".

Granted, this is a situation where the Org syntax is not very intuitive.
Anyway, the new function is more accurate.

I think, new variant should be committed even it does not fix Juan's case. He have not confirmed the fix yet.

Maybe we should require a space after punctuation following emphasized
text. I don't know. This is orthogonal to the current discussion.

I still believe in my expectation, however I admit such limitation of parser. At first I have not recognized that the issue may be similar to
https://orgmode.org/list/CAH+Wm4-_XHUZKFTf=ZtbfnCPvQWkbEoeGs8EpYm+8SPmu8LHFg@mail.gmail.com/
Anyway for my example workaround is to add more markers before, inside, and after the link. Maybe I will look closer at Tom's parser if it solves ambiguity in the same way.

In the meanwhile I have tried

     (benchmark-run 1 (org-sort-list t ?a))

in a file (1100 lines) obtained using

I don't think performance is really an issue. Of course, the suggested
function is clearly slower than the current one.

It is OK since difference is not really huge, especially taking into account that new variant was not compiled.

Do you still have problem with locale dependency of added tests? I can not guess what could be its source and expect that test should work reliably. Disregard "/3" in the subject of the patches. Third change is your code.

Attachment: 0001-More-tests-for-org-sort-list.patch
Description: Text Data

Attachment: 0002-testing-lisp-test-org.el-Non-obvious-cases-for-org-s.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]