From 069d43a7652e5b8bf07d33fd1013bdb8465012ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 14 Apr 2016 23:43:31 +0200 Subject: [PATCH] ui: 'package->recutils' accurately honors the number of columns. * guix/ui.scm (package->recutils)[width*]: New variable. Use it instead of WIDTH. --- guix/ui.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index f95c63a81b..391af9a99f 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -855,11 +855,16 @@ followed by \"+ \", which makes for a valid multi-line field value in the (define* (package->recutils p port #:optional (width (%text-width))) "Write to PORT a `recutils' record of package P, arranging to fit within WIDTH columns." + (define width* + ;; The available number of columns once we've taken into account space for + ;; the initial "+ " prefix. + (if (> width 2) (- width 2) width)) + (define (dependencies->recutils packages) (let ((list (string-join (map package-full-name (sort packages packagerecutils - (fill-paragraph list width + (fill-paragraph list width* (string-length "dependencies: "))))) (define (packagerecutils (string-trim-right - (parameterize ((%text-width width)) + (parameterize ((%text-width width*)) (texi->plain-text (string-append "description: " (or (and=> (package-description p) P_)