From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Human-readable file sorting Date: Sat, 20 Feb 2016 13:36:58 +0200 Message-ID: <8360xjpq91.fsf@gnu.org> References: <87povs41xg.fsf@gnus.org> <87bn7c3yms.fsf@gnus.org> <83si0npxtn.fsf@gnu.org> <87si0nlirx.fsf@gnus.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1455968261 1156 80.91.229.3 (20 Feb 2016 11:37:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Feb 2016 11:37:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 20 12:37:36 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 1aX5qx-0004Bq-Ud for ged-emacs-devel@m.gmane.org; Sat, 20 Feb 2016 12:37:36 +0100 Original-Received: from localhost ([::1]:60233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX5qu-0002Mh-2h for ged-emacs-devel@m.gmane.org; Sat, 20 Feb 2016 06:37:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX5qf-0002Al-DQ for emacs-devel@gnu.org; Sat, 20 Feb 2016 06:37:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aX5qb-0000rN-FK for emacs-devel@gnu.org; Sat, 20 Feb 2016 06:37:17 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX5qb-0000rJ-Ch; Sat, 20 Feb 2016 06:37:13 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1442 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aX5qa-0001WH-OC; Sat, 20 Feb 2016 06:37:13 -0500 In-reply-to: <87si0nlirx.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 20 Feb 2016 22:32:02 +1100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:200301 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Sat, 20 Feb 2016 22:32:02 +1100 > > Eli Zaretskii 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 I think it's supposed to sort strings while treating numeric parts of them specially. Its usage domain is wider than just file names. > > 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") You will see that 'ls' in a UTF-8 locale does the same.