diff options
author | Marius Bakke <mbakke@fastmail.com> | 2020-03-11 22:58:11 +0100 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2020-03-11 22:58:11 +0100 |
commit | 41c6e4f2b40f41cdbf4e8c7ade29845709f9cdf4 (patch) | |
tree | f496dcc2b11819f691cfe6063c52894f2ca76823 /guix/ui.scm | |
parent | 4510aeb91ce6267a14c9cead768869553b3a2279 (diff) | |
parent | 58363ee50096fd02743ff6d62ee1125fc440625f (diff) | |
download | patches-41c6e4f2b40f41cdbf4e8c7ade29845709f9cdf4.tar patches-41c6e4f2b40f41cdbf4e8c7ade29845709f9cdf4.tar.gz |
Merge branch 'master' into staging
Diffstat (limited to 'guix/ui.scm')
-rw-r--r-- | guix/ui.scm | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/guix/ui.scm b/guix/ui.scm index fbe2b70485..6f1ca9c0b2 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1218,16 +1218,23 @@ converted to a space; sequences of more than one line break are preserved." ;;; (define %text-width - (make-parameter (terminal-columns))) - -(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. 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))))) (define (texi->plain-text str) "Return a plain-text representation of texinfo fragment STR." |