From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CP7FCyeV+GAhAwAAgWs5BA (envelope-from ) for ; Wed, 21 Jul 2021 23:44:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qLRaByeV+GDEJAAA1q6Kng (envelope-from ) for ; Wed, 21 Jul 2021 21:44:07 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 84B807FAC for ; Wed, 21 Jul 2021 23:44:06 +0200 (CEST) Received: from localhost ([::1]:58874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6K0b-0006GJ-K5 for larch@yhetil.org; Wed, 21 Jul 2021 17:44:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6K0X-0006G6-TD for guix-patches@gnu.org; Wed, 21 Jul 2021 17:44:01 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6K0X-0000th-Kk for guix-patches@gnu.org; Wed, 21 Jul 2021 17:44:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m6K0X-0003Ui-Hv for guix-patches@gnu.org; Wed, 21 Jul 2021 17:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#30053] [PATCH 1/3] Improve appearance of tabular output. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Jul 2021 21:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30053 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30053@debbugs.gnu.org, Steve Sprang , Roel Janssen Received: via spool by 30053-submit@debbugs.gnu.org id=B30053.162690382413402 (code B ref 30053); Wed, 21 Jul 2021 21:44:01 +0000 Received: (at 30053) by debbugs.gnu.org; 21 Jul 2021 21:43:44 +0000 Received: from localhost ([127.0.0.1]:38809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6K0G-0003U6-JP for submit@debbugs.gnu.org; Wed, 21 Jul 2021 17:43:44 -0400 Received: from mail-qk1-f169.google.com ([209.85.222.169]:40515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6K0E-0003To-Rz for 30053@debbugs.gnu.org; Wed, 21 Jul 2021 17:43:43 -0400 Received: by mail-qk1-f169.google.com with SMTP id m68so3539908qke.7 for <30053@debbugs.gnu.org>; Wed, 21 Jul 2021 14:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=snU6o3e3fXtWGSqmSHB8bDOexWUUNo8n0uvkmkTAOMo=; b=btb/6mc3ijpvILAonp+VkrdN/iivNvZ3+CzBJjb+YRtCMhtpf0D4KqjwJK/W3EDUUD hhz8X9NmQ9fdPrEpGhB+C4MsyFR4aj6C/huwVo3mkpVM6ZYtT/MC78kFvwM1YQcF56dB qJ9De4ePJbXxIqyqFOqHLcoomkzGLENN6kwfRb5mYDLi2UPdivpWsCCWSq+SemuMhPNn oYhW03McDFkSxu8dzrd4A3lWRWMiLq6XTm1TIVGY1OAHBqxczfjVP/hSGwT/4VjEWApr 6B23sJrNnoMAjuFgPbBsLNheTLiRJelI3M87VNjn3W1Tde5KWTVU7GKYylIRxVuBrGed 4m8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=snU6o3e3fXtWGSqmSHB8bDOexWUUNo8n0uvkmkTAOMo=; b=SLwKFpG4JhzrgxExddTGlJVEeh68AyQULct33x6U8yj72+8qIDmb8z4teaC24EWwbc d/tSrlhO/zHVTz1WZByYG47uiTvPwmGikLfeh+mtMcsjPQu/iFh/I2mx3YYb/9i48Xvz nhQv4J6uJZpLhREIX1Xe490Ue9ZjKAWiYqo3GzcNoOJ0iFaw/CmH5e8PYtahZXTHrRsv 8fuZsjWuv9SqVy0mt7wKM+C5GaUgGtTshEh3h9KVmWgFrt5Bor3CcSYuARNTPgmULXbD miPPlaRVpG5yNFsRkM3mnell322fadPtjdJGcrm11pcdOAlsG9A+0DaktBjUxU/DYvsB jh7Q== X-Gm-Message-State: AOAM532qaBIPwP+4txiayGUVgmNsyML9LP/6iq2J2Uc2QRvtjqxJMq43 Ni00GP86z9s9U8jNdDSKOgg= X-Google-Smtp-Source: ABdhPJyexIeD0GSjMDeZeviHm72EvDm1kUQDxux1ZPhVJbqMTmOstlRdcx9pEo3WMTO6TcKn5z6kAg== X-Received: by 2002:a05:620a:15b:: with SMTP id e27mr38021555qkn.488.1626903817196; Wed, 21 Jul 2021 14:43:37 -0700 (PDT) Received: from hurd (dsl-236-124-77.b2b2c.ca. [207.236.124.77]) by smtp.gmail.com with ESMTPSA id k9sm6435584qti.88.2021.07.21.14.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 14:43:36 -0700 (PDT) From: Maxim Cournoyer References: <878td4nksy.fsf@gnu.org> <87fu7b2old.fsf@gnu.org> <87zi5d6g8f.fsf@gnu.org> <87im1cnnjb.fsf_-_@gmail.com> <871r7zcwdr.fsf_-_@gmail.com> <875yx3fvwh.fsf_-_@gnu.org> Date: Wed, 21 Jul 2021 17:43:26 -0400 In-Reply-To: <875yx3fvwh.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Wed, 21 Jul 2021 18:56:30 +0200") Message-ID: <87fsw7jqbl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626903846; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=snU6o3e3fXtWGSqmSHB8bDOexWUUNo8n0uvkmkTAOMo=; b=JobIclo6ocAuzFtRwmGuMWnBDYGEZfysxH4bBkwMmE0qSbdElzuRZyad0BlIktYcV3gI50 IPnaWEmaB0i/Mo0YhJqCyQV+VgPYgI561D3ZdZFwghqdf7+b7mGbX3axH4dbeEOTMXgSFH F1/nlwxrss0IznigPHc6MaCyInoc1AXyoMPCALxW3tC/M91np9rVOdRaeh4FAEjOSntpnf /lxjkveYNldd/A8kEfWcndOp39l1esNWmVLyyWQnxy7ON0TKkY+MiY+PuTKx1DdMe0SazG OThr36JZ0/EHDpXC9X4AQLKmEK9hTmaDDbw1h7C+GTAMbff+u0JBJnmd9b4kyA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626903846; a=rsa-sha256; cv=none; b=KP0WNh2t8fiOTw+iaYU0ABqsVrmu3wX0ydPEgwa6Mlk5wWq5JUyxFEOIVnzjP6M2JvffFA JlSFu9dMnA4oyLsnuz0Kb3EfcXbMDvbDrh1uJuK7hiZ/839xqbPlaDAGGUcInvuSzw1MrL jms/VgpvoD3cK+mEdWk+cTnD0Xyz4qQLqHtoeXJfh6HaY+mjIecYo7DYfz7dbxfXooR/IL kYD+47lgntdcN8gOh+7QxILrg2YpRtABlzQMFkCBCpmfDVePPElM4IHo03br/QDKW5W8BB XPGIlZqOkg6urMD2RAYkw9CFuRejEzBl4lGgBTLoduje0ktxkatD9RaT4jesKA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b="btb/6mc3"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.18 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b="btb/6mc3"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 84B807FAC X-Spam-Score: 0.18 X-Migadu-Scanner: scn0.migadu.com X-TUID: +ELEhgfQ/i2x Hello, Ludovic Court=C3=A8s writes: > Hi Maxim and all, > > Thank you for unlocking this old patch series. :-) > > Maxim Cournoyer skribis: > >>>>From d8fd6c9a1b8677cd69e50fe4f3e50c60c5fb7e35 Mon Sep 17 00:00:00 2001 >> From: Steve Sprang >> Date: Tue, 9 Jan 2018 14:00:11 -0800 >> Subject: [PATCH] utils: Add a procedure for pretty printing tabular data. >> >> * guix/utils.scm (pretty-print-table): New procedure. >> >> Co-authored-by: Maxim Cournoyer >> Signed-off-by: Maxim Cournoyer > > [...] > >> +(define* (pretty-print-table rows #:key (max-column-width 20)) >> + "Print ROWS in neat columns. All rows should be lists of strings and= each >> +row should have the same length. The columns are separated by a tab >> +character, and aligned using spaces. The maximum width of each column = is >> +bound by MAX-COLUMN-WIDTH." > > The version that was pushed has: > > (setvbuf (current-output-port) 'block) > > I=E2=80=99m in favor of removing it because it=E2=80=99s =E2=80=9Cimpolit= e=E2=80=9D so to speak :-) to > have such a side effect buried here. (guix ui) enables line-buffering > on startup anyway. Hehe, apologies. In my experiments, using 'block buffering seemed to improve performance a lot. Testing it again, the difference is insignificant. So I'm happy to attribute this to a measurement error on my part (perhaps I had forgotten to recompile the modified module, leading to the discrepancy, or perhaps another process was loading the system). Pushed with as commit 4f51a4ac27. > Ludo=E2=80=99. > > PS: Commit 01d7e8c2782f61e741f8beff7888adfbdb61779d shows an > incompatibility with some previously-fine uses of =E2=80=98cut=E2=80= =99, but surely > that was the price to pay. (An option would be to behave > differently depending on whether stdout is a tty or not, but that=E2= =80=99s > probably bad style=E2=80=A6) I pondered about that (using isatty), but considering people might pipe the output to less to interactively view it, that doesn't seem to be a good idea. Thanks for the feedback! Maxim