unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Sebastian Reuße" <seb@wirrsal.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 29803@debbugs.gnu.org
Subject: bug#29803: [PATCH] Fix output alignment in find-dired
Date: Fri, 22 Dec 2017 16:24:13 +0100	[thread overview]
Message-ID: <87a7ya23c2.fsf@wirrsal.net> (raw)
In-Reply-To: <83vagylt0m.fsf@gnu.org>

Hello Eli,

Eli Zaretskii <eliz@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





  reply	other threads:[~2017-12-22 15:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21  9:08 bug#29803: [PATCH] Fix output alignment in find-dired Sebastian Reuße
2017-12-21 18:08 ` Sebastian Reuße
2017-12-21 18:12   ` Sebastian Reuße
2017-12-22 14:46   ` Eli Zaretskii
2017-12-22 15:24     ` Sebastian Reuße [this message]
2017-12-22 15:24 ` Sebastian Reuße
2017-12-30 10:44   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a7ya23c2.fsf@wirrsal.net \
    --to=seb@wirrsal.net \
    --cc=29803@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).