summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-03-07 10:53:16 +0100
committerLudovic Courtès <ludo@gnu.org>2018-03-07 11:22:42 +0100
commit16de45557f782d23a87ae2fa394267d5826e834a (patch)
tree03d5cfe7d4cb816b219e4915e8f59b5997631b10
parente1ba6d49ea4df327e4dde9a994c4a89b71484d69 (diff)
downloadguix-16de45557f782d23a87ae2fa394267d5826e834a.tar.gz
ui: 'display-hint' preserves Texinfo formatting.
The previous method would mess up with @example formatting, for
instance.

* guix/ui.scm (display-hint): Parameterize '%text-width' instead of
using 'fill-paragraph'.
-rw-r--r--guix/ui.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 5b87f1e29b..cb49a15c4d 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -299,8 +299,10 @@ VARIABLE and return it, or #f if none was found."
   "Display MESSAGE, a l10n message possibly containing Texinfo markup, to
 PORT."
   (format port (G_ "hint: ~a~%")
-          (fill-paragraph (texi->plain-text message)
-                          (terminal-columns) 8)))
+          ;; XXX: We should arrange so that the initial indent is wider.
+          (parameterize ((%text-width (max 15
+                                           (- (terminal-columns) 5))))
+            (texi->plain-text message))))
 
 (define* (report-load-error file args #:optional frame)
   "Report the failure to load FILE, a user-provided Scheme file.