GNU bug report logs -
#18051
24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function?
Previous Next
Reported by: michael_heerdegen <at> web.de
Date: Fri, 18 Jul 2014 06:24:01 UTC
Severity: wishlist
Found in version 24.3.92
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Sat, 19 Jul 2014 11:17:15 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 18051 <at> 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.
This bug report was last modified 10 years and 224 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.