[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Human-readable file sorting
From: |
Lars Ingebrigtsen |
Subject: |
Re: Human-readable file sorting |
Date: |
Sat, 20 Feb 2016 22:32:02 +1100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
> Please don't call that function `file-string-lessp', or anything that
> has "file" in it. This sorting order has nothing to do with files.
Well, this is the function that's supposed to sort file names in the
order requested by the user, so that it has "file" in the name makes
sense to me. `file-name-lessp' is probably better, though.
> Names I can suggest include "logical", "intuitive", and "numerical".
Those are names for sorting predicates that behave in a specific manner,
and not something that directory-files (etc) should call directly.
> Btw, ls-lisp by default doesn't use string-lessp, it uses
> string-collate-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")
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Re: dired and ls, (continued)
- Re: dired and ls (was: Human-readable file sorting), Eli Zaretskii, 2016/02/20
- Re: dired and ls, John Wiegley, 2016/02/20
- Re: dired and ls, Eli Zaretskii, 2016/02/20
- Re: dired and ls, John Wiegley, 2016/02/20
- Re: dired and ls, Lars Ingebrigtsen, 2016/02/20
- Re: Human-readable file sorting, Eli Zaretskii, 2016/02/20
- Re: Human-readable file sorting,
Lars Ingebrigtsen <=
- Re: Human-readable file sorting, Eli Zaretskii, 2016/02/20
- Re: Human-readable file sorting, Lars Ingebrigtsen, 2016/02/20
- Re: Human-readable file sorting, Eli Zaretskii, 2016/02/20
- Re: Human-readable file sorting, Lars Ingebrigtsen, 2016/02/20
- Re: Human-readable file sorting, Richard Stallman, 2016/02/21
- Re: Human-readable file sorting, Lars Ingebrigtsen, 2016/02/21
- Re: Human-readable file sorting, Richard Stallman, 2016/02/22
- Re: Human-readable file sorting, Pierpaolo Bernardi, 2016/02/22
- Re: Human-readable file sorting, Eli Zaretskii, 2016/02/22
- Re: Human-readable file sorting, Richard Stallman, 2016/02/23