From d229215051b87bfc4657e8416f0e7b87c3ed620e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 28 Aug 2019 18:00:42 +0200 Subject: diagnostics: Avoid highlighting complete messages. * guix/diagnostics.scm (%highlight-argument): Don't highlight ARG if it contains white space. --- guix/diagnostics.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'guix/diagnostics.scm') 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))) -- cgit v1.2.3