unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Human-readable file sorting
@ 2016-02-20  1:15 Lars Ingebrigtsen
  2016-02-20  1:58 ` John Wiegley
  2016-02-20 14:32 ` Richard Stallman
  0 siblings, 2 replies; 63+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-20  1:15 UTC (permalink / raw)
  To: emacs-devel

Most file browsers these days sort files that have mixed
alphabetic/numerical content in a "logical" way for humans, and not
strictly according to their character values.  I wrote a bit about it,
but forgot to start the discussion here.  :-)

http://lars.ingebrigtsen.no/2014/10/13/campaign-for-humane-sorting/

To summarise:

When you have a directory with files like

file8.png
file9.png
file10.png
file11.png

humans recognise that these have increasing numerical content, and that
they probably should be sorted this way.  However, Emacs will sort them
this way:

file10.png
file11.png
file8.png
file9.png

Most modern file browsers will sort these files the human way, and I
think that Emacs should, too.

This applies to dired, but also to functions like `(directory-files
foo)'.  Possibly via new parameters or something, but I kinda think
that's not necessary.

Of course, we could have endless discussions about "what's a consecutive
sequence of numbers?"  Like file1,004.45.png?  Is that one number or
three?  But I don't think we need to.  :-) It's three.  We get 99% of
the use cases right by just being simple and stupid, I think.  (See the
longer discussion on the blog.)

So what do all y'all think?

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





^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2016-02-24 13:43 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-20  1:15 Human-readable file sorting Lars Ingebrigtsen
2016-02-20  1:58 ` John Wiegley
2016-02-20  2:26   ` Lars Ingebrigtsen
2016-02-20  2:33     ` John Wiegley
2016-02-20  6:00       ` Lars Ingebrigtsen
2016-02-20  6:12         ` Marcin Borkowski
2016-02-20  7:15           ` Lars Ingebrigtsen
2016-02-20  8:14             ` Marcin Borkowski
2016-02-22 18:09             ` Nikolaus Rath
2016-02-22 21:31               ` Marcin Borkowski
2016-02-23  6:13                 ` Yuri Khan
2016-02-23  8:32                   ` Andreas Schwab
2016-02-24  5:39                     ` Marcin Borkowski
2016-02-20  6:17         ` John Wiegley
2016-02-20  7:11           ` Lars Ingebrigtsen
2016-02-20  9:28         ` Eli Zaretskii
2016-02-20 10:24           ` martin rudalics
2016-02-20 10:53             ` Eli Zaretskii
2016-02-20 17:30         ` Michael Heerdegen
2016-02-20 18:25           ` Drew Adams
2016-02-20  6:16       ` dired and ls (was: Human-readable file sorting) Lars Ingebrigtsen
2016-02-20  6:19         ` dired and ls John Wiegley
2016-02-20  7:25           ` Lars Ingebrigtsen
2016-02-20  8:01             ` John Wiegley
2016-02-23  7:15               ` Thierry Volpiatto
2016-02-23 16:34                 ` John Wiegley
2016-02-20  9:57         ` dired and ls (was: Human-readable file sorting) Eli Zaretskii
2016-02-20 19:21           ` dired and ls John Wiegley
2016-02-20 21:02             ` Eli Zaretskii
2016-02-20 21:24               ` John Wiegley
2016-02-21  2:10           ` Lars Ingebrigtsen
2016-02-20  8:53     ` Human-readable file sorting Eli Zaretskii
2016-02-20 11:32       ` Lars Ingebrigtsen
2016-02-20 11:36         ` Eli Zaretskii
2016-02-20 11:45           ` Lars Ingebrigtsen
2016-02-20 12:35             ` Eli Zaretskii
2016-02-21  2:14               ` Lars Ingebrigtsen
2016-02-21 23:36                 ` Richard Stallman
2016-02-22  2:58                   ` Lars Ingebrigtsen
2016-02-22 18:01                     ` Richard Stallman
2016-02-22 18:13                       ` Pierpaolo Bernardi
2016-02-22 19:00                       ` Eli Zaretskii
2016-02-23 17:43                         ` Richard Stallman
2016-02-23 18:00                           ` Eli Zaretskii
2016-02-24  1:51                             ` Lars Ingebrigtsen
2016-02-24 13:43                               ` Richard Stallman
2016-02-24 13:41                             ` Richard Stallman
2016-02-20 14:23             ` Alexis
2016-02-20 14:43               ` Eli Zaretskii
2016-02-21  2:18               ` Lars Ingebrigtsen
2016-02-21  9:30                 ` Alexis
2016-02-21 10:07                   ` Lars Ingebrigtsen
2016-02-21 19:27                   ` Yuri Khan
2016-02-21 20:21                     ` Eli Zaretskii
2016-02-20 15:35       ` Pierpaolo Bernardi
2016-02-20 15:52         ` Eli Zaretskii
2016-02-21 12:45           ` Richard Stallman
2016-02-20 16:03         ` Herring, Davis
2016-02-20 16:23           ` Paul Eggert
2016-02-21  2:20         ` Lars Ingebrigtsen
2016-02-21 12:45         ` Richard Stallman
2016-02-21  2:38     ` Stefan Monnier
2016-02-20 14:32 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).