[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/10: ui: 'package->recutils' accurately honors the number of columns.
From: |
Ludovic Courtès |
Subject: |
07/10: ui: 'package->recutils' accurately honors the number of columns. |
Date: |
Thu, 14 Apr 2016 22:32:45 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 069d43a7652e5b8bf07d33fd1013bdb8465012ac
Author: Ludovic Courtès <address@hidden>
Date: Thu Apr 14 23:43:31 2016 +0200
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 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/guix/ui.scm b/guix/ui.scm
index f95c63a..391af9a 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 package<?)) " ")))
(string->recutils
- (fill-paragraph list width
+ (fill-paragraph list width*
(string-length "dependencies: ")))))
(define (package<? p1 p2)
@@ -901,7 +906,7 @@ WIDTH columns."
(format port "~a~2%"
(string->recutils
(string-trim-right
- (parameterize ((%text-width width))
+ (parameterize ((%text-width width*))
(texi->plain-text
(string-append "description: "
(or (and=> (package-description p) P_)
- branch master updated (85c7e8e -> b0a6a97), Ludovic Courtès, 2016/04/14
- 04/10: download: Send an ANSI erase-in-line sequence in addition to CR., Ludovic Courtès, 2016/04/14
- 02/10: gnu-maintenance: Recognize source tarball with "-src" in their name., Ludovic Courtès, 2016/04/14
- 09/10: guix download: Honor the number of columns of the terminal., Ludovic Courtès, 2016/04/14
- 08/10: ui: Use 'terminal-columns'., Ludovic Courtès, 2016/04/14
- 05/10: download: Add 'current-terminal-columns' parameter., Ludovic Courtès, 2016/04/14
- 10/10: substitute: Honor the number of columns of the client terminal., Ludovic Courtès, 2016/04/14
- 07/10: ui: 'package->recutils' accurately honors the number of columns.,
Ludovic Courtès <=
- 03/10: gnu-maintenance: Move FTP directory info to 'properties' fields., Ludovic Courtès, 2016/04/14
- 06/10: syscalls: Add TIOCGWINSZ bindings., Ludovic Courtès, 2016/04/14
- 01/10: upstream: Pass a package object to updaters., Ludovic Courtès, 2016/04/14