GNU bug report logs - #23373
25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1

Previous Next

Package: emacs;

Reported by: Jorge Morais <jorge13515 <at> gmail.com>

Date: Mon, 25 Apr 2016 13:54:02 UTC

Severity: minor

Tags: moreinfo

Found in version 25.0.93

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23373 in the body.
You can then email your comments to 23373 AT debbugs.gnu.org in the normal way.

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#23373; Package emacs. (Mon, 25 Apr 2016 13:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jorge Morais <jorge13515 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 25 Apr 2016 13:54:02 GMT) Full text and rfc822 format available.

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

From: Jorge Morais <jorge13515 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Mon, 25 Apr 2016 10:53:34 -0300
--block-size='1 is very convenient for human interpretation of large
file sizes, so it would be nice if Dired supported it.  If you cannot
support it, perhaps you should document this incompatibility in the
docstring of dired-listing-switches, and perhaps also in
[[info:emacs#Dired%20Enter][info:emacs#Dired Enter]].

-- 
I am Brazilian.  I apologize for possibly bad English and I welcome corrections.




Added tag(s) moreinfo. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 12 Aug 2020 02:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23373; Package emacs. (Wed, 12 Aug 2020 02:42:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Jorge Morais <jorge13515 <at> gmail.com>
Cc: 23373 <at> debbugs.gnu.org
Subject: Re: bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Tue, 11 Aug 2020 19:41:35 -0700
Jorge Morais <jorge13515 <at> gmail.com> writes:

> --block-size='1 is very convenient for human interpretation of large
> file sizes, so it would be nice if Dired supported it.  If you cannot
> support it, perhaps you should document this incompatibility in the
> docstring of dired-listing-switches, and perhaps also in
> [[info:emacs#Dired%20Enter][info:emacs#Dired Enter]].

I use:

   (setq dired-listing-switches "-alh")

Would that solve your use-case?

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23373; Package emacs. (Thu, 13 Aug 2020 01:09:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Jorge Morais <jorge13515 <at> gmail.com>, 23373 <at> debbugs.gnu.org
Subject: Re: bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Thu, 13 Aug 2020 02:35:43 +0300
>> --block-size='1 is very convenient for human interpretation of large
>> file sizes, so it would be nice if Dired supported it.  If you cannot
>> support it, perhaps you should document this incompatibility in the
>> docstring of dired-listing-switches, and perhaps also in
>> [[info:emacs#Dired%20Enter][info:emacs#Dired Enter]].
>
> I use:
>
>    (setq dired-listing-switches "-alh")
>
> Would that solve your use-case?

dired-mark-sexp should use dired-files-attributes (based on file-attributes)
instead of trying to parse all possible ls output formats.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23373; Package emacs. (Sat, 15 Aug 2020 13:59:02 GMT) Full text and rfc822 format available.

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

From: Jorge Morais Neto <jorge13515 <at> gmail.com>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: jorge+list <at> disroot.org, 23373 <at> debbugs.gnu.org
Subject: Re: bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Sat, 15 Aug 2020 10:58:39 -0300
Em ter., 11 de ago. de 2020 às 23:41, Stefan Kangas
<stefan <at> marxist.se> escreveu:
> I use:
>
>    (setq dired-listing-switches "-alh")
>
> Would that solve your use-case?

It would mostly solve my use case, but I have found a better solution:
num3-mode (package from GNU ELPA).

If you decide to leave the Dired code as is (despite the remark of Juri
Linkov) then I suggest documenting this incompatibility (as I said in the
original message) and possibly mention num3-mode.

Best regards

PS: I have since moved out of Gmail into Disroot, a more ethical
(software freedom and privacy) provider of email and other services.
This is now a secondary account, which I check once a week for messages
that still get sent to the old address.  Please send replies to my
jorge+list AT-SIGN disroot.org account.

--
- I am Brazilian.  I hope my English is correct and I welcome feedback




Removed tag(s) moreinfo. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 02 Oct 2020 10:03:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23373; Package emacs. (Thu, 02 Dec 2021 08:42:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jorge Morais <jorge13515 <at> gmail.com>
Cc: 23373 <at> debbugs.gnu.org
Subject: Re: bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Thu, 02 Dec 2021 09:40:52 +0100
Jorge Morais <jorge13515 <at> gmail.com> writes:

> --block-size='1 is very convenient for human interpretation of large
> file sizes, so it would be nice if Dired supported it.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I'm unable to reproduce this problem in the current Emacs.

Here's my recipe:

emacs -Q
C-u s -al --block-size='1  RET
M-( (> size 100000) RET

And it marked the files that are larger than 100000 bytes.

Are there any additional steps necessary to reproduce the problem?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 02 Dec 2021 08:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23373; Package emacs. (Thu, 02 Dec 2021 16:59:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Jorge Morais <jorge13515 <at> gmail.com>, 23373 <at> debbugs.gnu.org
Subject: Re: bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Thu, 02 Dec 2021 17:58:43 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I'm unable to reproduce this problem in the current Emacs.
>
> Here's my recipe:
>
> emacs -Q
> C-u s -al --block-size='1  RET
> M-( (> size 100000) RET

Here this does not work -- maybe because sizes look like 1.000 for me
and the "." distracts Emacs?  With other words: a problem that shows up
or not depending on the used locale settings?

Yes -- (> size 100000) seems to mark only sizes between 100 and 999.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23373; Package emacs. (Thu, 02 Dec 2021 17:03:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Jorge Morais <jorge13515 <at> gmail.com>, 23373 <at> debbugs.gnu.org
Subject: Re: bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Thu, 02 Dec 2021 18:02:20 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

>> emacs -Q
>> C-u s -al --block-size='1  RET
>> M-( (> size 100000) RET
>
> Here this does not work -- maybe because sizes look like 1.000 for me
> and the "." distracts Emacs?  With other words: a problem that shows up
> or not depending on the used locale settings?
>
> Yes -- (> size 100000) seems to mark only sizes between 100 and 999.

Right -- for me, the sizes show up as numbers without any dots using

C-u s -al --block-size='1

but I guess that's locale dependent.

As with many things in Dired, the "put stuff into a buffer and then try
to interpret it" leads to yet another bug...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23373; Package emacs. (Thu, 02 Dec 2021 17:17:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Jorge Morais <jorge13515 <at> gmail.com>, 23373 <at> debbugs.gnu.org
Subject: Re: bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Thu, 02 Dec 2021 18:16:31 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> As with many things in Dired, the "put stuff into a buffer and then
> try to interpret it" leads to yet another bug...

In my experience this is faster than asking for file-attributes all the
time, however

Anyway - seems `dired-x--string-to-number' is what has to be fixed...?

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23373; Package emacs. (Thu, 02 Dec 2021 17:51:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Jorge Morais <jorge13515 <at> gmail.com>, 23373 <at> debbugs.gnu.org
Subject: Re: bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Thu, 02 Dec 2021 18:50:29 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Anyway - seems `dired-x--string-to-number' is what has to be fixed...?

Yes, when I delete "." from the argument string in that function it
works.  But I wonder what formats we have to expect.  Deleting the dot
from e.g. "1.4k" would not be a good idea.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23373; Package emacs. (Fri, 03 Dec 2021 16:03:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Jorge Morais <jorge13515 <at> gmail.com>, 23373 <at> debbugs.gnu.org
Subject: Re: bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Fri, 03 Dec 2021 17:02:04 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Yes, when I delete "." from the argument string in that function it
> works.  But I wonder what formats we have to expect.  Deleting the dot
> from e.g. "1.4k" would not be a good idea.

It should be safe to remove the non-numeric chars if the final char
isn't a unit, so I've now done that on master.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 23373 <at> debbugs.gnu.org and Jorge Morais <jorge13515 <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 03 Dec 2021 16:03:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23373; Package emacs. (Fri, 03 Dec 2021 18:33:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Jorge Morais <jorge13515 <at> gmail.com>, 23373 <at> debbugs.gnu.org
Subject: Re: bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if
 dired-listing-switches contains --block-size='1
Date: Fri, 03 Dec 2021 19:32:27 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> It should be safe to remove the non-numeric chars if the final char
> isn't a unit, so I've now done that on master.

Works for me - thanks.

Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 01 Jan 2022 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 248 days ago.

Previous Next


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