Hello again, Since I have an old Emacs version (24.5.1) on my Raspberry, I've done a few more tests. The situation is the following:
1. On Arch Linux and Emacs 27.2: - The system locales are set to "es_ES.UTF-8". When, inside Emacs, I do M-x getenv RET LANG RET, I get "es_ES.UTF-8". org-sort-list a -> wrong result; - Launching Emacs from terminal with LANG=es_ES.UTF-8 \ etc... org-sort-list a -> wrong result again. 2. On Fedora 32 (virtual machine) and Emacs 27.1 - Everything as in the previous case. 3. On Raspian stretch and Emacs 24.5.1: - The system locales are set to "es_ES.UTF-8" as well. When, inside a normal Emacs session, I do M-x getenv RET lang RET, I get "es_ES.UTF-8". org-sort-list a -> wrong result; - Launching Emacs from terminal with LANG=es_ES.UTF-8 \ etc... In this case the list is ordered correctly, but I observe that similar forms with or without emphasis are not always ordered in the same way. Sometimes the non-emphasized forms are ordered before and sometimes they are ordered after (?). I don't know if I'm missing something... Best regards, Juan Manuel Juan Manuel Macías writes: > Hi Maxim, > > Thanks again. In my case, I keep getting the wrong result. In addition > to the test I did in a virtual machine with Fedora, I use Arch Linux in > my every day computers, with locales correctly (I hope) configured as > es_ES.UTF-8 (there was a typo in my previous mail, sorry: > 'en_ES.UTF-8'). In my /etc/locale.conf file I have: > > LANG=es_ES.UTF-8 > LC_ADDRESS=es_ES.UTF-8 > LC_IDENTIFICATION=es_ES.UTF-8 > LC_MEASUREMENT=es_ES.UTF-8 > LC_MONETARY=es_ES.UTF-8 > LC_NAME=es_ES.UTF-8 > LC_NUMERIC=es_ES.UTF-8 > LC_PAPER=es_ES.UTF-8 > LC_TELEPHONE=es_ES.UTF-8 > LC_TIME=es_ES.UTF-8 > > And with locale -a, I get a list of enabled locales: > > C > en_US.utf8 > es_ES.utf8 > POSIX > > However, I keep getting the wrong result :-( (Arch, Emacs 27.2). > > Even with > > LANG=en_EN.UTF-8 \ > emacs -nw -Q -L ~/src/org-mode/lisp/ -L ~/src/org-mode/contrib/lisp/ \ > list.org > > Maybe the problem is on Arch's side (?), although it was also reproducible > in the test I did with Fedora in virtual machine and Emacs 27. > > Best regards, > > Juan Manuel > > Maxim Nikulin writes: > >> On 14/04/2021 02:08, Juan Manuel Macías wrote: >>> The situation is that with locales configured for Spanish from Spain >>> (en_ES.UTF-8) the list is not ordered correctly, unless those three >>> spaces from org-sort-remove-invisible are removed. But I couldn't say >>> why or if that would be appropriate as a patch... >> >> Did not you get a warning like the following one? >> >> (process:220): Gtk-WARNING **: 15:17:45.066: Locale not supported by C >> library. >> Using the fallback 'C' locale. >> >>> Regarding the collation rule of forms with emphasis, at least in Spanish >>> these should come after the non-emphasized forms. I don't know if this >>> is a general rule also for other languages (at least it seems more >>> natural that the forms without emphasis are placed before). >> >> LANG=es_ES.UTF-8 \ >> emacs -Q -L ~/src/org-mode/lisp/ -L ~/src/org-mode/contrib/lisp/ \ >> list.org >> >> - a >> - /a/ >> - v >> - /v/ >> >> So it works accordingly to your expectation. Emacs 25.2.2, >> Ubuntu-18.04 container. >> >> I have generated es_ES.UTF-8 locale using >> >> dpkg-reconfigure locales >> >> Depending on linux distribution you run, the locale may be ready to >> use or not. I tend to think that in minimal environment of virtual >> machine it was missed. >> >> I had an idea to add a test for sorting of items including emphasized >> ones but test-org-list/sort forces C locale. Maybe it was done to >> avoid failures due to missed locale. >> >> >