From: Juri Linkov <juri@linkov.net>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, emacs-devel@gnu.org
Subject: Re: master 71783e9: Add the string-numeric-lessp function
Date: Mon, 07 Mar 2016 02:16:12 +0200 [thread overview]
Message-ID: <8737s3jfrr.fsf@mail.linkov.net> (raw)
In-Reply-To: <56CA8BB8.6040908@cs.ucla.edu> (Paul Eggert's message of "Sun, 21 Feb 2016 20:16:56 -0800")
> At least, that's been the tradition in other GNU tools. GNU ls -v applies
> the string-version-lessp algorithm to every pair of file names that it
> considers, and it works on arbitrary file names. It sounds like you may be
> thinking of some other tradition, although I'm not sure what that tradition
> would be.
>
> The GNU ls -v approach works well in practice, because people who care
> about version numbers tend to name their files consistently. E.g., they do
> not put files "foo001.png" "foo1.png" in the same directory, because that
> kind of usage would confuse humans no matter what 'ls -v' does.
I tried GNU ls -v, but unfortunately it is unusable because of a bug in
GNU ls -v. It places backup files before original files, e.g. `ls -lv`
-rw-r--r-- 1 158,018 Feb 23 12:01 dired.el
-rw-r--r-- 1 117,286 Feb 23 12:23 dired.elc
-rw-r--r-- 1 110,076 Feb 23 12:01 dired-aux.el
-rw-r--r-- 1 81,586 Feb 23 12:23 dired-aux.elc
-rw-r--r-- 1 253 Feb 23 12:12 dired-loaddefs.el~
-rw-r--r-- 1 20,628 Feb 23 12:12 dired-loaddefs.el
-rw-r--r-- 1 66,420 Feb 23 12:01 dired-x.el
-rw-r--r-- 1 47,687 Feb 23 12:23 dired-x.elc
dired-loaddefs.el~ is sorted to come before dired-loaddefs.el
whereas in `ls -l`
-rw-r--r-- 1 110,076 Feb 23 12:01 dired-aux.el
-rw-r--r-- 1 81,586 Feb 23 12:23 dired-aux.elc
-rw-r--r-- 1 158,018 Feb 23 12:01 dired.el
-rw-r--r-- 1 117,286 Feb 23 12:23 dired.elc
-rw-r--r-- 1 20,628 Feb 23 12:12 dired-loaddefs.el
-rw-r--r-- 1 253 Feb 23 12:12 dired-loaddefs.el~
-rw-r--r-- 1 66,420 Feb 23 12:01 dired-x.el
-rw-r--r-- 1 47,687 Feb 23 12:23 dired-x.elc
dired-loaddefs.el~ naturally comes after dired-loaddefs.el
(as dired.elc naturally comes after dired.el).
The same bug now propagates to ‘string-version-lessp’:
(sort '(
"dired.el"
"dired.elc"
"dired-aux.el"
"dired-aux.elc"
"dired-loaddefs.el"
"dired-loaddefs.el~"
"dired-x.el"
"dired-x.elc"
)
'string-version-lessp)
=>
"dired.el"
"dired.elc"
"dired-aux.el"
"dired-aux.elc"
"dired-loaddefs.el~" <=
"dired-loaddefs.el" <=
"dired-x.el"
"dired-x.elc"
next prev parent reply other threads:[~2016-03-07 0:16 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160221043348.25201.81719@vcs.savannah.gnu.org>
[not found] ` <E1aXLiO-0006ZB-4R@vcs.savannah.gnu.org>
2016-02-21 4:43 ` master 71783e9: Add the string-numeric-lessp function Lars Ingebrigtsen
2016-02-21 5:36 ` Lars Ingebrigtsen
2016-02-21 6:15 ` Stephan Mueller
2016-02-21 10:02 ` Lars Ingebrigtsen
2016-02-21 19:35 ` Yuri Khan
2016-02-22 2:51 ` Lars Ingebrigtsen
2016-02-22 17:59 ` Richard Stallman
2016-02-21 21:30 ` Paul Eggert
2016-02-22 1:32 ` Andy Moreton
2016-02-22 4:01 ` Paul Eggert
2016-02-22 16:11 ` Eli Zaretskii
2016-02-22 2:53 ` Lars Ingebrigtsen
2016-02-22 3:50 ` Paul Eggert
2016-02-22 4:00 ` Lars Ingebrigtsen
2016-02-22 4:16 ` Paul Eggert
2016-02-22 4:22 ` Lars Ingebrigtsen
2016-02-22 5:56 ` Paul Eggert
2016-03-07 0:16 ` Juri Linkov [this message]
2016-03-07 0:53 ` Paul Eggert
2016-03-07 17:45 ` Richard Stallman
2016-03-07 17:49 ` Lars Magne Ingebrigtsen
2016-03-07 23:55 ` Juri Linkov
2016-03-07 23:52 ` Juri Linkov
2016-03-08 2:06 ` Paul Eggert
2016-03-08 9:26 ` Andreas Schwab
2016-03-09 9:26 ` Paul Eggert
2016-03-07 2:27 ` Drew Adams
2016-03-07 21:14 ` Johan Bockgård
2016-03-07 22:03 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8737s3jfrr.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.