GNU bug report logs - #20739
25.0.50; Dired switches have no effect when explicit list of files provided

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Fri, 5 Jun 2015 08:35:02 UTC

Severity: normal

Merged with 952

Found in version 25.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 20739 <at> debbugs.gnu.org
Subject: bug#20739: 25.0.50; Dired switches have no effect when explicit list of files provided
Date: Sat, 06 Jun 2015 12:36:31 +0300
> Date: Fri, 5 Jun 2015 01:34:40 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> 
> emacs -Q
> 
> Given two files whose names are a.el and b.el, with b.el more recent
> than a.el.
> 
> M-: (dired '("foo" "a.el" "b.el") "-lstF")
> 
> The files are listed in alphabetic order, not by date as specified by
> arg SWITCHES and as indicated in the mode line.

No, they are listed in the order in which you specified them in the
list passed as the first argument to 'dired'.  That just happened to
coincide with alphabetic order in your case.

You evidently expected 'dired' to apply the order-related options in
switches to the entire list of files.  But that's not what 'dired'
does when it is called with its 1st argument a list.  What it does is
invoke 'insert-directory' with each of the files in the list, in
order, passing it the value of switches.  So when calling 'dired' in
this manner, the order-related switches have no effect whatsoever.

I've updated the doc string to mention this peculiarity.

> Hitting `s' any number of times has no effect on the order of the
> files.

For the same reason.




This bug report was last modified 10 years and 6 days ago.

Previous Next


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