bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Alan Mackenzie
Subject: bug#714: directory-files: Doc string is irritatingly vague wrt sorting.
Date: Wed, 13 Aug 2008 19:11:41 +0000
User-agent: Mutt/1.5.9i

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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]