GNU bug report logs -
#39853
26.3; Sort on file-newer-than-file-p does not work outside home folder
Previous Next
Reported by: dalanicolai <dalanicolai <at> gmail.com>
Date: Sun, 1 Mar 2020 11:40:02 UTC
Severity: minor
Tags: notabug
Found in version 26.3
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #15 received at 39853-done <at> debbugs.gnu.org (full text, mbox):
Andreas Schwab <schwab <at> linux-m68k.org> writes:
> On Mär 01 2020, dalanicolai wrote:
>
>> Although I tried to send this mail from plain emacs and from spacemacs. I
>> was not sure if it worked and did not find a way to check if it worked (At
>> least I did not receive any confirmation e-mail). Although I created this
>> bug report in spacemacs. I tested the behavior using emacs -Q
>>
>> 1. evaluate (sort (directory-files "~") 'file-newer-than-file-p)
>> 2. evaluate previous sexp with a different path ~ inserted: e.g.
>> .emacs.d folder as shown in the attachment
>>
>> The sexp with the home folder returns a date modified list while the
>> sexp with a different folder does not. The attachment shows both folder
>> contents of ordered on date modified in nautilus and the returned lists
>> from evaluating the sexps. The order of the home folder list is
>> consistent with that nautilus while that of the .emacs.d folder is not.
>
> That's because most of the files from ~/.emacs.d don't exist in
> default-directory, and nonexisting files are sorted last by
> file-newer-than-file-p. Either use (directory-files "~/.emacs.d" t), or
> (let ((default-directory "~/.eamcs.d")) ...).
This is behaving as documented, and is not a bug. Andreas Schwab
explains above how to use this function correctly. I'm therefore
closing this bug report.
Best regards,
Stefan Kangas
This bug report was last modified 4 years and 350 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.