GNU bug report logs - #714
directory-files: Doc string is irritatingly vague wrt sorting.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Wed, 13 Aug 2008 19:15:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 714 in the body.
You can then email your comments to 714 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#714; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: bug-gnu-emacs <at> gnu.org
Subject: directory-files:  Doc string is irritatingly vague wrt sorting.
Date: Wed, 13 Aug 2008 19:11:41 +0000
Hi, Emacs!

The doc string for directory files is:

    directory-files is a built-in function in `src/dired.c'.
    (directory-files DIRECTORY &optional FULL MATCH NOSORT)

    Return a list of names of files in DIRECTORY.
    There are three optional arguments:
    If FULL is non-nil, return absolute file names.  Otherwise return names
    that are relative to the specified directory.
    If MATCH is non-nil, mention only file names that match the regexp MATCH.
    If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
     NOSORT is useful if you plan to sort the result yourself.

This sort of implies (but doesn't state) that if NOSORT is nil, the
returned list is sorted.

More importantly, it doesn't state the predicate used for the sorting.
"Obviously", this will be some sort of alphabetical sort, but this gets
complicated for mixed case filenames and (more importantly) for character
sets which aren't vanilla ASCII.

-- 
Alan Mackenzie (Nuremberg, Germany).





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#714; Package emacs. Full text and rfc822 format available.

Message #8 received at 714 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 714 <at> debbugs.gnu.org
Subject: Re: bug#714: directory-files: Doc string is irritatingly vague wrt sorting.
Date: Fri, 15 Aug 2008 15:14:51 -0400
Alan Mackenzie wrote:

> More importantly, it doesn't state the predicate used for the sorting.
> "Obviously", this will be some sort of alphabetical sort, but this gets
> complicated for mixed case filenames and (more importantly) for character
> sets which aren't vanilla ASCII.

Will saying it uses `string-lessp' be good enough for you? The details
of said function are in the Elisp manual.




Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Alan Mackenzie <acm <at> muc.de>:
bug acknowledged by developer. Full text and rfc822 format available.

Message #13 received at 714-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 714-done <at> debbugs.gnu.org
Subject: Re: directory-files:  Doc string is irritatingly vague wrt sorting.
Date: Fri, 15 Aug 2008 16:19:06 -0400
I've clarified the docstring.  Thanks.




bug archived. Request was from Debbugs Internal Request <don <at> donarmstrong.com> to internal_control <at> emacsbugs.donarmstrong.com. (Sat, 13 Sep 2008 14:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 284 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.