summary refs log tree commit diff
path: root/guix/diagnostics.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-08-28 18:00:42 +0200
committerLudovic Courtès <ludo@gnu.org>2019-08-28 18:52:52 +0200
commitd229215051b87bfc4657e8416f0e7b87c3ed620e (patch)
treed530a34c5b026181395e57cd771a8e9bf2225155 /guix/diagnostics.scm
parent8f67a76a544a9ff7b60de64d5619a63296c9553e (diff)
downloadguix-d229215051b87bfc4657e8416f0e7b87c3ed620e.tar.gz
diagnostics: Avoid highlighting complete messages.
* guix/diagnostics.scm (%highlight-argument): Don't highlight ARG if it
contains white space.
Diffstat (limited to 'guix/diagnostics.scm')
-rw-r--r--guix/diagnostics.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/diagnostics.scm b/guix/diagnostics.scm
index 380cfbb613..6c0753aef4 100644
--- a/guix/diagnostics.scm
+++ b/guix/diagnostics.scm
@@ -71,7 +71,12 @@ is a trivial format string."
 (define* (%highlight-argument arg #:optional (port (guix-warning-port)))
   "Highlight ARG, a format string argument, if PORT supports colors."
   (cond ((string? arg)
-         (highlight arg port))
+         ;; If ARG contains white space, don't highlight it, on the grounds
+         ;; that it may be a complete message in its own, like those produced
+         ;; by 'guix lint.
+         (if (string-any char-set:whitespace arg)
+             arg
+             (highlight arg port)))
         ((symbol? arg)
          (highlight (symbol->string arg) port))
         (else arg)))