From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexis Newsgroups: gmane.emacs.devel Subject: Re: Human-readable file sorting Date: Sun, 21 Feb 2016 01:23:19 +1100 Message-ID: <87k2lzpijs.fsf@gmail.com> References: <87povs41xg.fsf@gnus.org> <87bn7c3yms.fsf@gnus.org> <83si0npxtn.fsf@gnu.org> <87si0nlirx.fsf@gnus.org> <8360xjpq91.fsf@gnu.org> <87oabbli5g.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: ger.gmane.org 1455978243 17730 80.91.229.3 (20 Feb 2016 14:24:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Feb 2016 14:24:03 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 20 15:23:52 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 1aX8Rs-0006PU-20 for ged-emacs-devel@m.gmane.org; Sat, 20 Feb 2016 15:23:52 +0100 Original-Received: from localhost ([::1]:33150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX8Rr-0001ip-B3 for ged-emacs-devel@m.gmane.org; Sat, 20 Feb 2016 09:23:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX8RZ-0001gO-M9 for emacs-devel@gnu.org; Sat, 20 Feb 2016 09:23:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aX8RV-0006AX-On for emacs-devel@gnu.org; Sat, 20 Feb 2016 09:23:33 -0500 Original-Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]:33366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX8RQ-00069o-VQ; Sat, 20 Feb 2016 09:23:25 -0500 Original-Received: by mail-pf0-x22f.google.com with SMTP id q63so67199383pfb.0; Sat, 20 Feb 2016 06:23:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-type; bh=Jnmq4kh28LEB1XAUxR6aWphSbWYleNjdSF+Zotw6D3U=; b=XDRHDoS/JpXSjF1GXAygE5/gyVRlDVnY+0VTVP3dzG/T3L2pUji5c3nL4L6H44lU5s mGq2BDQ8J6AsWD9vsE4zSmRxp8rGa19kCD5LTNVJDbECGOyxQ9inPeRzLTuvAmGaxUql +epN5WkRvl5XV5tteHUHX6x2QBUoZ53Vj+e+1N/jQKOAnt9qxuZjGZWnloJI8MJIJLe7 7/zjPkc6vWjdVPCPqeBjiaqTqU1f5THARD++Dcpo9KcKzMNnSYQ9QWGaoeMCW16e5PCS cc84pCymcwsLVsNjlkp/WaACr+sLu0pc+6/QM3hHMfRpep9CJbRY/fepeyY2+U2cwEC+ N4Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-type; bh=Jnmq4kh28LEB1XAUxR6aWphSbWYleNjdSF+Zotw6D3U=; b=VMl8N3EveeEZhmO4AgTYDbT5QsomMq4LNBTlN0W4UBUY2pJBDLJuItF2VHcuXjEYUR iq18DrjZ63J1mbh3SPuXX04Wk9iSZY09UvRy3Pec4Ce00E9LT8U3H3U3u6wchZlDaGiz 00qh68ZYWnMYbJFfeoiw4eiQdWBtIRAKuz03ZSell9QN04LGeYDdLgrbuW04FdMaIngW 4HW421E/2cWCcqbD3Zz0Fef4iC8mA5shTwuxRHN5g7GODkRKB1uXrP9wMcHvW9/KSXjU vCX+tzlK4xdduK5hzuQgCnbl6pXfedgg63BANHkUx6YNWIoUpl6RWOKmgEtDnpW3E6bX 4qAg== X-Gm-Message-State: AG10YOT+5LdWCNjPud6peWxUFClq3M+dJmuzMhko3dquSryrKQgC8o7hnb/2Yi3b11VUuQ== X-Received: by 10.98.17.28 with SMTP id z28mr25948216pfi.38.1455978203832; Sat, 20 Feb 2016 06:23:23 -0800 (PST) Original-Received: from localhost (114-198-79-98.dyn.iinet.net.au. [114.198.79.98]) by smtp.gmail.com with ESMTPSA id w89sm25061402pfi.13.2016.02.20.06.23.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Feb 2016 06:23:23 -0800 (PST) User-agent: mu4e 0.9.16; emacs 24.5.3 In-reply-to: <87oabbli5g.fsf@gnus.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::22f 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:200307 Archived-At: Lars Ingebrigtsen writes: > The definition of that function will be just > > (if some-user-setting > (string-lessp ...) > (logical-string-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. > > Huh, I never noticed: > > larsi@mouse:/tmp/zot$ echo $LANG en_US.UTF-8 > larsi@mouse:/tmp/zot$ ls 1* 10 11 1.1 12 > > But: > > larsi@mouse:/tmp/zot$ ls foo* foo12.txt foo1.txt foo2.txt > > Sorting is hard! Indeed. :-) But, having read all the other posts in this discussion, i'm still not clear whether `logical-string-lessp` would use `string-collate-lessp` "under the hood" (or at least follow the value of LC_COLLATE or its closest equivalent)? i ask due to things like this: https://github.com/flexibeast/org-vcard/issues/18#issuecomment-92006062 Alexis.