GNU bug report logs - #18051
24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function?

Previous Next

Package: emacs;

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 18051 <at> debbugs.gnu.org
Subject: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function?
Date: Sat, 19 Jul 2014 11:17:15 +0300
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: 18051 <at> debbugs.gnu.org
> Date: Sat, 19 Jul 2014 03:25:01 +0200
> 
> over the current sorting, I would much prefer having all the dot
> files at the end.  (I don't know if this is possible with ls.)

If 'ls' cannot do that, I think we should have this in Dired.

> > 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.  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.

Can you see the answer in 'ls' sources?  Does just "en_US" or
"en_US.8859-1" change the order?

> > >   (2) -v sorting (sorting versions correctly)
> >
> > Isn't this what "ls -v" does?  If so, and if ls-lisp doesn't currently
> > support that, patches to add such support are welcome.
> 
> ls -v sorts backup versions in their natural order (which is not the
> lexicographic order).  Yes, would be good to have that in ls-lisp, and
> should not be too hard.  I can give it a try when I get the time.

Thanks.

> I'm not sure what would have to be done about the locale depend part.

Assuming it's indeed the locale thing, Emacs doesn't yet support
locale-specific sorting.  But we could do that in some ad-hoc manner
anyway.




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.