GNU bug report logs -
#29803
[PATCH] Fix output alignment in find-dired
Previous Next
Reported by: Sebastian Reuße <seb <at> wirrsal.net>
Date: Thu, 21 Dec 2017 16:30:02 UTC
Severity: minor
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 29803 <at> debbugs.gnu.org (full text, mbox):
Hello Eli,
Eli Zaretskii <eliz <at> gnu.org> writes:
> Thanks. Could you please provide a minimum example to demonstrate the
> current code's mis-alignment and how your patch fixes that?
You can reproduce the alignment issue when using the example from the
`find-ls-option` docs:
(let ((find-ls-option '("-exec ls -ldh {} +" . "-ldh")))
(find-dired "/tmp" "-type f"))
E.g., for me, this yields:
-rw------- 1 seb users 226K 22. Dez 14:59 emacs-trustFuURayKH
-rw------- 1 seb users 226K 22. Dez 14:59 emacs-trustI8LaIFbp
-rw------- 1 seb users 156 22. Dez 14:58 serverauth.Zq2gEantga
-r--r--r-- 1 seb users 11 22. Dez 14:58 .X0-lock
find-dired uses a regex group to align the size column. This group
currently does not include the size suffix, so when using
human-formatted output, the remaining columns are misaligned.
When we include the suffix in the capture group, we get the desired
alignment:
-rw------- 1 seb users 226K 22. Dez 14:59 emacs-trustFuURayKH
-rw------- 1 seb users 226K 22. Dez 14:59 emacs-trustI8LaIFbp
-rw------- 1 seb users 156 22. Dez 14:58 serverauth.Zq2gEantga
-r--r--r-- 1 seb users 11 22. Dez 14:58 .X0-lock
Actually, it now occurs to me that the suffix might vary in case, e.g.
when using ‘--si’ output. I’d propose we instead have the group capture
all consecutive non-whitespace (cf. superseding patch). This would then
also cover the decimal and thousands separators.
Kind regards,
SR
--
Insane cobra split the wood
Trader of the lowland breed
Call a jittney, drive away
In the slipstream we will stay
This bug report was last modified 7 years and 147 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.