|
From: | Alexis |
Subject: | Re: Human-readable file sorting |
Date: | Sun, 21 Feb 2016 01:23:19 +1100 |
User-agent: | mu4e 0.9.16; emacs 24.5.3 |
Lars Ingebrigtsen <address@hidden> writes:
The definition of that function will be just(if some-user-setting (string-lessp ...) (logical-string-lessp ...))Hm, interesting...(sort '("11" "12" "1 1" "1 2" "1.1" "1.2") 'string-collate-lessp) => ("11" "1 1" "1.1" "12" "1 2" "1.2")You will see that 'ls' in a UTF-8 locale does the same.Huh, I never noticed:address@hidden:/tmp/zot$ echo $LANG en_US.UTF-8 address@hidden:/tmp/zot$ ls 1* 10 11 1.1 12But: address@hidden:/tmp/zot$ ls foo* foo12.txt foo1.txt foo2.txt Sorting is hard!
Indeed. :-)But, having read all the other posts in this discussion, i'm still not clear whether `logical-string-lessp` would use `string-collate-lessp` "under the hood" (or at least follow the value of LC_COLLATE or its closest equivalent)? i ask due to things like this:
https://github.com/flexibeast/org-vcard/issues/18#issuecomment-92006062 Alexis.
[Prev in Thread] | Current Thread | [Next in Thread] |