emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [DISCUSSION] Sorting strings in Org mode vs. system locale


From: Ihor Radchenko
Subject: Re: [DISCUSSION] Sorting strings in Org mode vs. system locale
Date: Sat, 11 May 2024 09:38:34 +0000

Max Nikulin <manikulin@gmail.com> 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'.
>
> `compare-strings' with upcase conversion under the hood may be an 
> alternative.

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=413192698
I replaced the two fallback variants with #'string< and custom downcase
function with a single fallback that uses `compare-strings'.

Closed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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