[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#54668] [PATCH 3/3] diagnostics: Turn diagnostic locations into hype
From: |
Ludovic Courtès |
Subject: |
[bug#54668] [PATCH 3/3] diagnostics: Turn diagnostic locations into hyperlinks. |
Date: |
Fri, 1 Apr 2022 17:01:46 +0200 |
* guix/diagnostics.scm (print-diagnostic-prefix): Use
'location->hyperlink' when 'supports-hyperlinks?' returns true.
---
guix/diagnostics.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/guix/diagnostics.scm b/guix/diagnostics.scm
index 2b8cee1ccb..bf1ced8140 100644
--- a/guix/diagnostics.scm
+++ b/guix/diagnostics.scm
@@ -204,7 +204,10 @@ (define prefix-color
(gettext prefix %gettext-domain))))
(if location
(format (guix-warning-port) "~a: ~a"
- (location-color (location->string location))
+ (location-color
+ (if (supports-hyperlinks? (guix-warning-port))
+ (location->hyperlink location)
+ (location->string location)))
(prefix-color prefix))
(format (guix-warning-port) "~:[~*~;guix ~a: ~]~a"
(program-name) (program-name)
--
2.34.0