GNU bug report logs -
#20739
25.0.50; Dired switches have no effect when explicit list of files provided
Previous Next
Full log
View this message in rfc822 format
> 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.