all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 70132@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"Christopher Baines" <guix@cbaines.net>,
	"Josselin Poiret" <dev@jpoiret.xyz>,
	"Ludovic Courtès" <ludo@gnu.org>,
	"Mathieu Othacehe" <othacehe@gnu.org>,
	"Ricardo Wurmus" <rekado@elephly.net>,
	"Simon Tournier" <zimon.toutoune@gmail.com>,
	"Tobias Geerinckx-Rice" <me@tobias.gr>
Subject: [bug#70132] [PATCH 09/11] ui: Delay use of (guix build syscalls).
Date: Mon,  1 Apr 2024 22:25:21 +0200	[thread overview]
Message-ID: <52b532346c5eb27375681127542bf3c8152723db.1712002698.git.ludo@gnu.org> (raw)
In-Reply-To: <cover.1712002698.git.ludo@gnu.org>

This ensures (guix build syscalls) is loaded only when needed.

* guix/ui.scm (%text-width): Unconditionally alias ‘*line-width*’.
Remove initialization.
<top level>: 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 '())
-- 
2.41.0





  parent reply	other threads:[~2024-04-01 20:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 20:22 [bug#70132] [PATCH 00/11] Improve startup time and memory footprint for short-lived commands Ludovic Courtès
2024-04-01 20:25 ` [bug#70132] [PATCH 01/11] channels: Use SRFI-71 instead of SRFI-11 Ludovic Courtès
2024-04-15 22:41   ` Simon Tournier
2024-04-01 20:25 ` [bug#70132] [PATCH 02/11] git: Add ‘repository-info’ and use it in (guix channels) Ludovic Courtès
2024-04-01 20:25 ` [bug#70132] [PATCH 03/11] channels: Move ‘commit-short-id’ to (guix git) Ludovic Courtès
2024-04-01 20:25 ` [bug#70132] [PATCH 04/11] git: Add ‘tag->commit’ and use it in (guix channels) Ludovic Courtès
2024-04-01 20:25 ` [bug#70132] [PATCH 05/11] channels: Autoload (git …) modules Ludovic Courtès
2024-04-15 22:45   ` Simon Tournier
2024-04-01 20:25 ` [bug#70132] [PATCH 06/11] guix system: Autoload some more Ludovic Courtès
2024-04-01 20:25 ` [bug#70132] [PATCH 07/11] utils: Don’t re-export ‘call-with-temporary-output-file’ Ludovic Courtès
2024-04-01 20:25 ` [bug#70132] [PATCH 08/11] guix: Delay loading of (gnutls) Ludovic Courtès
2024-04-01 20:25 ` Ludovic Courtès [this message]
2024-04-01 20:25 ` [bug#70132] [PATCH 10/11] Autoload (guix build syscalls) Ludovic Courtès
2024-04-01 20:25 ` [bug#70132] [PATCH 11/11] Autoload (gcrypt hash) Ludovic Courtès
2024-04-15 21:43 ` bug#70132: [PATCH 00/11] Improve startup time and memory footprint for short-lived commands Ludovic Courtès
     [not found] ` <handler.70132.D70132.17132174197570.notifdone@debbugs.gnu.org>
2024-04-15 22:57   ` [bug#70132] Not receiving Emails from Debbugs (was Re: bug#70132: closed ...) Simon Tournier
2024-04-16 16:42     ` Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=52b532346c5eb27375681127542bf3c8152723db.1712002698.git.ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=70132@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=guix@cbaines.net \
    --cc=me@tobias.gr \
    --cc=othacehe@gnu.org \
    --cc=rekado@elephly.net \
    --cc=zimon.toutoune@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.