emacs-devel
[Top][All Lists]
Advanced

[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 13:26:51 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

John Wiegley <address@hidden> writes:

>>>>>> Lars Ingebrigtsen <address@hidden> writes:
>
>> So what do all y'all think?
>
> It looks like GNU ls support "human sorting" using -v, so you can always use
> C-u s to add this flag, or change your default set of flags to use it.
>
> Whether it needs to be the dired sorting default... I don't see a strong need
> for that, given that it can be customized.

Well, it's not just dired.  For instance, if you say `C-x f file<TAB>',
you get a help buffer listing all the files that match.  This should
also be sorted in a human readable fashion.  When you push `n' in an
image mode buffer, it takes you to the next file, and that should also
be the next, as humans see it.

This stuff is all over Emacs, and it's either because the functions rely
on the sorting from `directory-files', or because they call
`string-lessp' explicitly.

The practical way to implement this is to provide a `file-string-lessp'
function that can be configured to sort the way the user prefers,
defaulting to human readable sorting, and then we adjust
`directory-files' and other file-ey commands to call that instead of
`string-lessp'.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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