From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? Date: Sat, 19 Jul 2014 13:56:02 +0300 Message-ID: <83fvhx62il.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <837g3b6ob7.fsf@gnu.org> <874myfatyo.fsf@web.de> <831ttj6lu5.fsf@gnu.org> <87zjg79dhw.fsf@web.de> <83wqba6cpe.fsf@gnu.org> <8761iujg2a.fsf@web.de> <83lhrp69v8.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1405767448 7158 80.91.229.3 (19 Jul 2014 10:57:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Jul 2014 10:57:28 +0000 (UTC) Cc: 18051@debbugs.gnu.org To: michael_heerdegen@web.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 19 12:57:17 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1X8SKL-0006hj-6i for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Jul 2014 12:57:17 +0200 Original-Received: from localhost ([::1]:53827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8SKK-0005fu-Sd for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Jul 2014 06:57:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8SKC-0005d8-0H for bug-gnu-emacs@gnu.org; Sat, 19 Jul 2014 06:57:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X8SK6-0003UI-2l for bug-gnu-emacs@gnu.org; Sat, 19 Jul 2014 06:57:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8SK5-0003U0-WE for bug-gnu-emacs@gnu.org; Sat, 19 Jul 2014 06:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X8SK5-0003de-KZ for bug-gnu-emacs@gnu.org; Sat, 19 Jul 2014 06:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Jul 2014 10:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18051 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18051-submit@debbugs.gnu.org id=B18051.140576738013936 (code B ref 18051); Sat, 19 Jul 2014 10:57:01 +0000 Original-Received: (at 18051) by debbugs.gnu.org; 19 Jul 2014 10:56:20 +0000 Original-Received: from localhost ([127.0.0.1]:59050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8SJQ-0003ci-6g for submit@debbugs.gnu.org; Sat, 19 Jul 2014 06:56:20 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:49488) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8SJN-0003cR-H2 for 18051@debbugs.gnu.org; Sat, 19 Jul 2014 06:56:19 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0N8Y00E00GT38L00@a-mtaout21.012.net.il> for 18051@debbugs.gnu.org; Sat, 19 Jul 2014 13:56:09 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8Y00EPYH1L8O00@a-mtaout21.012.net.il>; Sat, 19 Jul 2014 13:56:09 +0300 (IDT) In-reply-to: <83lhrp69v8.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91659 Archived-At: > Date: Sat, 19 Jul 2014 11:17:15 +0300 > From: Eli Zaretskii > Cc: 18051@debbugs.gnu.org > > > > But if 'ls' supports that, so should ls-lisp. > > > > It depends on "locale" settings. I tried some settings of the LC_ALL > > variable. With "C" or "POSIX", I get the same sorting as with ls-lisp. > > OTOH, with "en_US.utf8" or "de_DE.utf8" I get the sorting I described, > > with dot files merged with the other files. > > AFAICT, 'ls' uses strcoll. I don't see how can that effectively > ignore the leading dot, but maybe I'm missing something. I think I know the answer: those versions of 'ls' that do this are based on libc implementation that supports UTS#10, the Unicode Collation Algorithm, or at least part of it. UTS#10 specifies a multi-level comparison, whereby base characters, accents, and letter-case variants are compared before punctuation characters. > OTOH, if the UTF-8 codeset says the leading dot should be ignored, > then ls-lisp should do the same by default, at least when the > locale's codeset is UTF-8. For this, we would need a UTS#10 compatible compare-strings. Then ls-lisp could simply use it when the locale is .UTF-8. Alternatively, we could have an approximation to that, just for sorting non-punctuation characters before the punctuation characters.