From patchwork Mon Apr 1 20:25:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 62450 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A86D827BBEA; Mon, 1 Apr 2024 21:27:41 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 24BD227BBE2 for ; Mon, 1 Apr 2024 21:27:41 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrOFF-0008UJ-Md; Mon, 01 Apr 2024 16:27:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrOFE-0008TV-1Q for guix-patches@gnu.org; Mon, 01 Apr 2024 16:27:04 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rrOFB-0006wm-W6; Mon, 01 Apr 2024 16:27:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rrOFD-0007LO-9i; Mon, 01 Apr 2024 16:27:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70132] [PATCH 09/11] ui: Delay use of (guix build syscalls). Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 01 Apr 2024 20:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70132 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70132@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 70132-submit@debbugs.gnu.org id=B70132.171200317128141 (code B ref 70132); Mon, 01 Apr 2024 20:27:03 +0000 Received: (at 70132) by debbugs.gnu.org; 1 Apr 2024 20:26:11 +0000 Received: from localhost ([127.0.0.1]:51727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrOEM-0007Jj-Q4 for submit@debbugs.gnu.org; Mon, 01 Apr 2024 16:26:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrOEJ-0007Gi-AE for 70132@debbugs.gnu.org; Mon, 01 Apr 2024 16:26:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrOEA-0006nd-A3; Mon, 01 Apr 2024 16:25:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=ywQloDwUQn6ZdDOQbc27ynvE4p+/omn3dMl9Qc9kC7U=; b=WbcFhYRptyMj7h3u264k fiiIEJ8HD2VQ+IJgDjgk3dXeQuQXZf60+53XYk+xo8aEDCnU8WM/tB4XHW0l004gKKUmGCipPsj2s lsE0ZpK2mNeBJHFf9wCBRt6w6muqNE2s8oEIg0YHqA1UDNU8IeUD/z+su60EdzgmAMYl5tKlKXvNZ vNoTxNDvqfO4EB1ahshXOBLDBbAjp87xz2Ytjfb5Ebvk76mXL+ExFR6IVmZI3WVWbzKYomhoYaNHZ HUKZUPRm7UF/SYQTOejaTvZB2fWSKdiK5sReyTtzUHTNGgbnDny+idcHvnJMH/SYGrkj48nPwV2Ma rEAUvW8NNdfflA==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 1 Apr 2024 22:25:21 +0200 Message-ID: <52b532346c5eb27375681127542bf3c8152723db.1712002698.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This ensures (guix build syscalls) is loaded only when needed. * guix/ui.scm (%text-width): Unconditionally alias ‘*line-width*’. Remove initialization. : Remove code for Guile < 2.2.7. (package->recutils): Change default #:width to (terminal-columns). Change-Id: I990a1b5b0f20a6243e47e314d1d3d4f8298b7151 --- guix/ui.scm | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index 34ff210930..d82fa533cc 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1473,23 +1473,9 @@ (define* (fill-paragraph str width #:optional (column 0)) ;;; (define %text-width - ;; '*line-width*' was introduced in Guile 2.2.7/3.0.1. On older versions of - ;; Guile, monkey-patch 'wrap*' below. - (if (defined? '*line-width*) - (let ((parameter (fluid->parameter *line-width*))) - (parameter (terminal-columns)) - parameter) - (make-parameter (terminal-columns)))) - -(unless (defined? '*line-width*) ;Guile < 2.2.7 - (set! (@@ (texinfo plain-text) wrap*) - ;; XXX: Monkey patch this private procedure to let 'package->recutils' - ;; parameterize the fill of description field correctly. - (lambda strings - (let ((indent (fluid-ref (@@ (texinfo plain-text) *indent*)))) - (fill-string (string-concatenate strings) - #:line-width (%text-width) #:initial-indent indent - #:subsequent-indent indent))))) + ;; '*line-width*' was introduced in Guile 2.2.7/3.0.1. Keep this alias for + ;; backward-compatibility and for convenience. + (fluid->parameter *line-width*)) (define (texi->plain-text str) "Return a plain-text representation of texinfo fragment STR." @@ -1535,7 +1521,7 @@ (define (string->recutils str) '() str))) -(define* (package->recutils p port #:optional (width (%text-width)) +(define* (package->recutils p port #:optional (width (terminal-columns)) #:key (hyperlinks? (supports-hyperlinks? port)) (extra-fields '())