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: Thu, 15 Apr 2021 21:58:23 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

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.




reply via email to

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