GNU bug report logs - #16533
24.3.50; "s" no longer works as documented in dired

Previous Next

Package: emacs;

Reported by: Markus Triska <markus.triska <at> gmx.at>

Date: Fri, 24 Jan 2014 00:35:01 UTC

Severity: normal

Found in version 24.3.50

To reply to this bug, email your comments to 16533 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16533; Package emacs. (Fri, 24 Jan 2014 00:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Markus Triska <markus.triska <at> gmx.at>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 24 Jan 2014 00:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Markus Triska <markus.triska <at> gmx.at>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; "s" no longer works as documented in dired
Date: Fri, 24 Jan 2014 01:33:46 +0100
When I do:

   $ emacs -Q

and then view my home directory in dired with:

   C-x C-f RET

and then list all files in decreasing order of their file sizes with:

   C-u s S RET

(making the switches read: "-alS")

and then press "s", dired says "Dired by date" but still orders by size.

This works as expected in Emacs 22.1.1, where "s" then sorts by date.


In GNU Emacs 24.3.50.2 (x86_64-apple-darwin10.8.0, X toolkit, Xaw3d scroll bars)
 of 2014-01-04 on mt-imac.local
Windowing system distributor `The X.Org Foundation', version 11.0.11404000
Configured using:
 `configure CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16533; Package emacs. (Fri, 24 Jan 2014 03:11:02 GMT) Full text and rfc822 format available.

Message #8 received at 16533 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Markus Triska <markus.triska <at> gmx.at>
Cc: 16533 <at> debbugs.gnu.org
Subject: Re: bug#16533: 24.3.50; "s" no longer works as documented in dired
Date: Thu, 23 Jan 2014 22:10:12 -0500
Markus Triska wrote:

> When I do:
>
>    $ emacs -Q
>
> and then view my home directory in dired with:
>
>    C-x C-f RET
>
> and then list all files in decreasing order of their file sizes with:
>
>    C-u s S RET
>
> (making the switches read: "-alS")
>
> and then press "s", dired says "Dired by date" but still orders by size.

So is the complaint that it says "Dired by date"?
I can't reproduce this.

> This works as expected in Emacs 22.1.1, where "s" then sorts by date.

I don't understand. "-alS" means ls should sort by size.
Sort by date would be "-alt".

> In GNU Emacs 24.3.50.2 (x86_64-apple-darwin10.8.0, X toolkit, Xaw3d scroll bars)
>  of 2014-01-04 on mt-imac.local




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16533; Package emacs. (Fri, 24 Jan 2014 03:14:02 GMT) Full text and rfc822 format available.

Message #11 received at 16533 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Markus Triska <markus.triska <at> gmx.at>
Cc: 16533 <at> debbugs.gnu.org
Subject: Re: bug#16533: 24.3.50; "s" no longer works as documented in dired
Date: Thu, 23 Jan 2014 22:13:11 -0500
Glenn Morris wrote:

>> This works as expected in Emacs 22.1.1, where "s" then sorts by date.
>
> I don't understand.

Oh, I see. Works for me.

What is the value of dired-use-ls-dired?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16533; Package emacs. (Fri, 24 Jan 2014 17:25:02 GMT) Full text and rfc822 format available.

Message #14 received at 16533 <at> debbugs.gnu.org (full text, mbox):

From: Markus Triska <markus.triska <at> gmx.at>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 16533 <at> debbugs.gnu.org
Subject: Re: bug#16533: 24.3.50; "s" no longer works as documented in dired
Date: Fri, 24 Jan 2014 18:23:43 +0100
Glenn Morris <rgm <at> gnu.org> writes:

> What is the value of dired-use-ls-dired?

Its value is nil. When I start dired after "$ emacs -Q", it displays:

  ls does not support --dired; see `dired-use-ls-dired' for more details.

Following the instructions in the documentation of `dired-use-ls-dired',
I tried Emacs's own emulation of "ls" by evaluating (in "$ emacs -Q"):

  (setq ls-lisp-use-insert-directory-program nil)
  (require 'ls-lisp)

The original problem shows up with this emulation as well.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16533; Package emacs. (Fri, 24 Jan 2014 18:33:01 GMT) Full text and rfc822 format available.

Message #17 received at 16533 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Markus Triska <markus.triska <at> gmx.at>
Cc: 16533 <at> debbugs.gnu.org
Subject: Re: bug#16533: 24.3.50; "s" no longer works as documented in dired
Date: Fri, 24 Jan 2014 13:32:55 -0500
Markus Triska wrote:

> The original problem shows up with this emulation as well.

Not for me.

Please confirm what the problem actually is - just that it says "by
date" in the mode line?

When it does so, what are the values of

dired-ls-sorting-switches
dired-sort-by-date-regexp
dired-actual-switches




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16533; Package emacs. (Sat, 25 Jan 2014 11:03:01 GMT) Full text and rfc822 format available.

Message #20 received at 16533 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Markus Triska <markus.triska <at> gmx.at>
Cc: rgm <at> gnu.org, 16533 <at> debbugs.gnu.org
Subject: Re: bug#16533: 24.3.50; "s" no longer works as documented in dired
Date: Sat, 25 Jan 2014 13:02:11 +0200
> From: Markus Triska <markus.triska <at> gmx.at>
> Date: Fri, 24 Jan 2014 18:23:43 +0100
> Cc: 16533 <at> debbugs.gnu.org
> 
> Glenn Morris <rgm <at> gnu.org> writes:
> 
> > What is the value of dired-use-ls-dired?
> 
> Its value is nil. When I start dired after "$ emacs -Q", it displays:
> 
>   ls does not support --dired; see `dired-use-ls-dired' for more details.
> 
> Following the instructions in the documentation of `dired-use-ls-dired',
> I tried Emacs's own emulation of "ls" by evaluating (in "$ emacs -Q"):
> 
>   (setq ls-lisp-use-insert-directory-program nil)
>   (require 'ls-lisp)
> 
> The original problem shows up with this emulation as well.

Aren't you using ls-lisp emulation by default?  What does the
following produce in "emacs -Q"?

  M-: (featurep 'ls-lisp) RET




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16533; Package emacs. (Sat, 25 Jan 2014 11:24:01 GMT) Full text and rfc822 format available.

Message #23 received at 16533 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 16533 <at> debbugs.gnu.org, markus.triska <at> gmx.at
Subject: Re: bug#16533: 24.3.50; "s" no longer works as documented in dired
Date: Sat, 25 Jan 2014 13:22:46 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Fri, 24 Jan 2014 13:32:55 -0500
> Cc: 16533 <at> debbugs.gnu.org
> 
> Please confirm what the problem actually is - just that it says "by
> date" in the mode line?

I think the problem is that is says "by date", but the actual sorting
is not changed, i.e. it stays by size in this case.

> When it does so, what are the values of
> 
> dired-ls-sorting-switches

"SXU"

> dired-sort-by-date-regexp

"\\(\\`\\| \\)-[^- ]*t[^ SXU]*\\(\\(\\`\\| +\\)\\(--[^ ]+\\|-[^- tSXU]+\\)\\)* *$"

> dired-actual-switches

"-alSt"

And the latter is the root cause of the problem, IMO: the -S switch is
not removed from dired-actual-switches.

The problem here seems to be that dired-sort-toggle blindly adds the
"-t" flag to dired-actual-switches, although in this case the sorting
is not by date at all.  I don't understand the logic here; it seems
like dired-sort-toggle assumes without testing that the directory is
sorted either by date or by name, which is of course false.

Is it a portable assumption that the last switch that determines the
sorting order overrides all the previous ones?  If so, ls-lisp.el
should be fixed to implement that requirement.  But if not, we need to
fix dired.el not to put more than one sorting option into
dired-actual-switches.  In particular, the logic in dired-sort-toggle
seems to be flawed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16533; Package emacs. (Sun, 26 Jan 2014 01:32:02 GMT) Full text and rfc822 format available.

Message #26 received at 16533 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 16533 <at> debbugs.gnu.org, markus.triska <at> gmx.at
Subject: Re: bug#16533: 24.3.50; "s" no longer works as documented in dired
Date: Sat, 25 Jan 2014 20:31:44 -0500
Eli Zaretskii wrote:

> The problem here seems to be that dired-sort-toggle blindly adds the
> "-t" flag to dired-actual-switches, although in this case the sorting
> is not by date at all.  I don't understand the logic here; it seems
> like dired-sort-toggle assumes without testing that the directory is
> sorted either by date or by name, which is of course false.
>
> Is it a portable assumption that the last switch that determines the
> sorting order overrides all the previous ones?  If so, ls-lisp.el
> should be fixed to implement that requirement.  But if not, we need to
> fix dired.el not to put more than one sorting option into
> dired-actual-switches.  In particular, the logic in dired-sort-toggle
> seems to be flawed.

Duh, I seem to have been very thick here, since the original report
seems clear now. I guess I missed the 'then press "s"'.

I guess it is not a portable assumption, since presumably whatever
crappy ls Mac OS X uses does not work that way.

Prior to r101356, dired-sort-toggle removed dired-ls-sorting-switches.
Now it seems not to. That change was made to fix another bug,
http://debbugs.gnu.org/6987




This bug report was last modified 11 years and 140 days ago.

Previous Next


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