From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: master 71783e9: Add the string-numeric-lessp function Date: Mon, 07 Mar 2016 02:16:12 +0200 Organization: LINKOV.NET Message-ID: <8737s3jfrr.fsf@mail.linkov.net> References: <20160221043348.25201.81719@vcs.savannah.gnu.org> <87twl2fzaw.fsf@gnus.org> <56CA2C66.7040306@cs.ucla.edu> <87povpzc9c.fsf@gnus.org> <56CA8578.2030004@cs.ucla.edu> <87twl1xul1.fsf@gnus.org> <56CA8BB8.6040908@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1457310598 5373 80.91.229.3 (7 Mar 2016 00:29:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Mar 2016 00:29:58 +0000 (UTC) Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 07 01:29:46 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1acj3R-00082H-35 for ged-emacs-devel@m.gmane.org; Mon, 07 Mar 2016 01:29:45 +0100 Original-Received: from localhost ([::1]:52704 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acj3Q-0003ha-2I for ged-emacs-devel@m.gmane.org; Sun, 06 Mar 2016 19:29:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acj3B-0003hS-Nc for emacs-devel@gnu.org; Sun, 06 Mar 2016 19:29:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acj37-0002Um-NC for emacs-devel@gnu.org; Sun, 06 Mar 2016 19:29:29 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:38463 helo=homiemail-a23.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acj37-0002Ud-HX for emacs-devel@gnu.org; Sun, 06 Mar 2016 19:29:25 -0500 Original-Received: from homiemail-a23.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTP id EA2FC4B0062; Sun, 6 Mar 2016 16:29:23 -0800 (PST) Original-Received: from localhost.linkov.net (62.65.224.79.cable.starman.ee [62.65.224.79]) (Authenticated sender: jurta@jurta.org) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTPA id E4EFC4B0058; Sun, 6 Mar 2016 16:29:22 -0800 (PST) In-Reply-To: <56CA8BB8.6040908@cs.ucla.edu> (Paul Eggert's message of "Sun, 21 Feb 2016 20:16:56 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.91 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 69.163.253.7 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201030 Archived-At: > At least, that's been the tradition in other GNU tools. GNU ls -v appli= es > 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 tradi= tion > 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 th= at > 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 =E2=80=98string-version-lessp=E2=80=99: (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) =3D> "dired.el" "dired.elc" "dired-aux.el" "dired-aux.elc" "dired-loaddefs.el~" <=3D "dired-loaddefs.el" <=3D "dired-x.el" "dired-x.elc"