From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Sebastian =?UTF-8?Q?Reu=C3=9Fe?= Newsgroups: gmane.emacs.bugs Subject: bug#29803: [PATCH] Fix output alignment in find-dired Date: Fri, 22 Dec 2017 16:24:13 +0100 Message-ID: <87a7ya23c2.fsf@wirrsal.net> References: <20171221090817.32535-1-seb@wirrsal.net> <20171221180811.12831-1-seb@wirrsal.net> <83vagylt0m.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1513958071 31618 195.159.176.226 (22 Dec 2017 15:54:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 22 Dec 2017 15:54:31 +0000 (UTC) User-Agent: mu4e 1.0-alpha2; emacs 25.3.1 Cc: 29803@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 22 16:54:26 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSPeS-0007dL-7i for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Dec 2017 16:54:24 +0100 Original-Received: from localhost ([::1]:55392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSPgP-0003zV-Qb for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Dec 2017 10:56:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSPC6-0002E4-KD for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2017 10:25:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSPC2-00005Y-Jk for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2017 10:25:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39520) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eSPC2-00005O-F5 for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2017 10:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eSPC2-0007Bg-5i for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2017 10:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sebastian =?UTF-8?Q?Reu=C3=9Fe?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Dec 2017 15:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29803 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 29803-submit@debbugs.gnu.org id=B29803.151395625727537 (code B ref 29803); Fri, 22 Dec 2017 15:25:02 +0000 Original-Received: (at 29803) by debbugs.gnu.org; 22 Dec 2017 15:24:17 +0000 Original-Received: from localhost ([127.0.0.1]:48198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSPBJ-0007A5-Ih for submit@debbugs.gnu.org; Fri, 22 Dec 2017 10:24:17 -0500 Original-Received: from wirrsal.net ([188.68.36.149]:44392 helo=mail.wirrsal.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSPBI-00079w-1y for 29803@debbugs.gnu.org; Fri, 22 Dec 2017 10:24:16 -0500 Original-Received: from localhost (i577A0059.versanet.de [87.122.0.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wirrsal.net (Postfix) with ESMTPSA id B827834ABD3; Fri, 22 Dec 2017 16:24:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wirrsal.net; s=wirrsal; t=1513956254; bh=PlwqngwV3Zr5YwI1pJCgiPekrz3Zv7iuXBu/A9loHi0=; h=References:From:To:Cc:Subject:In-reply-to:Date; b=uaVEUvt6D8SMs+9f/nPcHogjBjIh8nPSqGn3rwypXrM8DU1QDGc3xjBwZQryNcn2h lU92TgNgeP/mVanuU4txCsT46NPvnMa67tNnROHE2m1cI3qkV+uEly74ZKGiK+0po/ 1K0HLTY/OV0XR/X+WqczS9KUZyLzHjHBFdttFSM0= In-reply-to: <83vagylt0m.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:141385 Archived-At: Hello Eli, Eli Zaretskii 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