unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
@ 2016-04-25 13:53 Jorge Morais
  2020-08-12  2:41 ` Stefan Kangas
  2021-12-02  8:40 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 11+ messages in thread
From: Jorge Morais @ 2016-04-25 13:53 UTC (permalink / raw)
  To: 23373

--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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
  2016-04-25 13:53 bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1 Jorge Morais
@ 2020-08-12  2:41 ` Stefan Kangas
  2020-08-12 23:35   ` Juri Linkov
  2020-08-15 13:58   ` Jorge Morais Neto
  2021-12-02  8:40 ` Lars Ingebrigtsen
  1 sibling, 2 replies; 11+ messages in thread
From: Stefan Kangas @ 2020-08-12  2:41 UTC (permalink / raw)
  To: Jorge Morais; +Cc: 23373

Jorge Morais <jorge13515@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
  2020-08-12  2:41 ` Stefan Kangas
@ 2020-08-12 23:35   ` Juri Linkov
  2020-08-15 13:58   ` Jorge Morais Neto
  1 sibling, 0 replies; 11+ messages in thread
From: Juri Linkov @ 2020-08-12 23:35 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Jorge Morais, 23373

>> --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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
  2020-08-12  2:41 ` Stefan Kangas
  2020-08-12 23:35   ` Juri Linkov
@ 2020-08-15 13:58   ` Jorge Morais Neto
  1 sibling, 0 replies; 11+ messages in thread
From: Jorge Morais Neto @ 2020-08-15 13:58 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: jorge+list, 23373

Em ter., 11 de ago. de 2020 às 23:41, Stefan Kangas
<stefan@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
  2016-04-25 13:53 bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1 Jorge Morais
  2020-08-12  2:41 ` Stefan Kangas
@ 2021-12-02  8:40 ` Lars Ingebrigtsen
  2021-12-02 16:58   ` Michael Heerdegen
  1 sibling, 1 reply; 11+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-02  8:40 UTC (permalink / raw)
  To: Jorge Morais; +Cc: 23373

Jorge Morais <jorge13515@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
  2021-12-02  8:40 ` Lars Ingebrigtsen
@ 2021-12-02 16:58   ` Michael Heerdegen
  2021-12-02 17:02     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2021-12-02 16:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Jorge Morais, 23373

Lars Ingebrigtsen <larsi@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
  2021-12-02 16:58   ` Michael Heerdegen
@ 2021-12-02 17:02     ` Lars Ingebrigtsen
  2021-12-02 17:16       ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-02 17:02 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Jorge Morais, 23373

Michael Heerdegen <michael_heerdegen@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
  2021-12-02 17:02     ` Lars Ingebrigtsen
@ 2021-12-02 17:16       ` Michael Heerdegen
  2021-12-02 17:50         ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2021-12-02 17:16 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Jorge Morais, 23373

Lars Ingebrigtsen <larsi@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
  2021-12-02 17:16       ` Michael Heerdegen
@ 2021-12-02 17:50         ` Michael Heerdegen
  2021-12-03 16:02           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2021-12-02 17:50 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Jorge Morais, 23373

Michael Heerdegen <michael_heerdegen@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
  2021-12-02 17:50         ` Michael Heerdegen
@ 2021-12-03 16:02           ` Lars Ingebrigtsen
  2021-12-03 18:32             ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-03 16:02 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Jorge Morais, 23373

Michael Heerdegen <michael_heerdegen@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1
  2021-12-03 16:02           ` Lars Ingebrigtsen
@ 2021-12-03 18:32             ` Michael Heerdegen
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Heerdegen @ 2021-12-03 18:32 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Jorge Morais, 23373

Lars Ingebrigtsen <larsi@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-12-03 18:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-25 13:53 bug#23373: 25.0.93; dired-mark-sexp misinterprets file sizes if dired-listing-switches contains --block-size='1 Jorge Morais
2020-08-12  2:41 ` Stefan Kangas
2020-08-12 23:35   ` Juri Linkov
2020-08-15 13:58   ` Jorge Morais Neto
2021-12-02  8:40 ` Lars Ingebrigtsen
2021-12-02 16:58   ` Michael Heerdegen
2021-12-02 17:02     ` Lars Ingebrigtsen
2021-12-02 17:16       ` Michael Heerdegen
2021-12-02 17:50         ` Michael Heerdegen
2021-12-03 16:02           ` Lars Ingebrigtsen
2021-12-03 18:32             ` Michael Heerdegen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).