mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-26 20:49:29 -05:00
ui: Restore line wrapping for 'package->recutils'.
Fixes a regression introduced when switching to Guile 3.0.0 whereby monkey-patching 'wrap*' wouldn't have any effects due to inlining. * guix/ui.scm (%text-width): Define in terms of the '*line-width*' fluid when it's defined. <top level>: Set (@@ (texinfo plain-text) wrap*) only when '*line-width*' is undefined.
This commit is contained in:
parent
10c2ca9e4a
commit
3c1ea8dcef
1 changed files with 16 additions and 9 deletions
25
guix/ui.scm
25
guix/ui.scm
|
@ -1218,16 +1218,23 @@ (define (maybe-break chr result)
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define %text-width
|
(define %text-width
|
||||||
(make-parameter (terminal-columns)))
|
;; '*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))))
|
||||||
|
|
||||||
(set! (@@ (texinfo plain-text) wrap*)
|
(unless (defined? '*line-width*) ;Guile < 2.2.7
|
||||||
;; XXX: Monkey patch this private procedure to let 'package->recutils'
|
(set! (@@ (texinfo plain-text) wrap*)
|
||||||
;; parameterize the fill of description field correctly.
|
;; XXX: Monkey patch this private procedure to let 'package->recutils'
|
||||||
(lambda strings
|
;; parameterize the fill of description field correctly.
|
||||||
(let ((indent (fluid-ref (@@ (texinfo plain-text) *indent*))))
|
(lambda strings
|
||||||
(fill-string (string-concatenate strings)
|
(let ((indent (fluid-ref (@@ (texinfo plain-text) *indent*))))
|
||||||
#:line-width (%text-width) #:initial-indent indent
|
(fill-string (string-concatenate strings)
|
||||||
#:subsequent-indent indent))))
|
#:line-width (%text-width) #:initial-indent indent
|
||||||
|
#:subsequent-indent indent)))))
|
||||||
|
|
||||||
(define (texi->plain-text str)
|
(define (texi->plain-text str)
|
||||||
"Return a plain-text representation of texinfo fragment STR."
|
"Return a plain-text representation of texinfo fragment STR."
|
||||||
|
|
Loading…
Reference in a new issue