From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Human-readable file sorting Date: Sat, 20 Feb 2016 22:32:02 +1100 Message-ID: <87si0nlirx.fsf@gnus.org> References: <87povs41xg.fsf@gnus.org> <87bn7c3yms.fsf@gnus.org> <83si0npxtn.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1455967996 30175 80.91.229.3 (20 Feb 2016 11:33:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Feb 2016 11:33:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 20 12:33:02 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 1aX5mX-0000tP-VG for ged-emacs-devel@m.gmane.org; Sat, 20 Feb 2016 12:33:02 +0100 Original-Received: from localhost ([::1]:60210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX5mX-0006SL-7B for ged-emacs-devel@m.gmane.org; Sat, 20 Feb 2016 06:33:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX5m9-0006Mx-SW for emacs-devel@gnu.org; Sat, 20 Feb 2016 06:32:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aX5m6-00086W-MR for emacs-devel@gnu.org; Sat, 20 Feb 2016 06:32:37 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:46744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX5m6-000864-Gi; Sat, 20 Feb 2016 06:32:34 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aX5lh-0003CL-Rb; Sat, 20 Feb 2016 12:32:11 +0100 In-Reply-To: <83si0npxtn.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Feb 2016 10:53:24 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aX5lh-0003CL-Rb MailScanner-NULL-Check: 1456572731.84176@V0bY0LDFsNZ2jl7h2p3J9g X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 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:200300 Archived-At: 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, so that it has "file" in the name makes sense to me. `file-name-lessp' is probably better, though. > Names I can suggest include "logical", "intuitive", and "numerical". Those are names for sorting predicates that behave in a specific manner, and not something that directory-files (etc) should call directly. > 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") -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no