GNU bug report logs - #39853
26.3; Sort on file-newer-than-file-p does not work outside home folder

Previous Next

Package: emacs;

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 #8 received at 39853 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: dalanicolai <dalanicolai <at> gmail.com>
Cc: 39853 <at> debbugs.gnu.org
Subject: Re: bug#39853: 26.3;
 Sort on file-newer-than-file-p does not work outside home folder
Date: Sun, 01 Mar 2020 14:14:06 +0100
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")) ...).

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




This bug report was last modified 4 years and 271 days ago.

Previous Next


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