From 13307c198bcd1fbd9364bcb7ef4c6d19d287cf2c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 1 Apr 2022 16:54:52 +0200 Subject: diagnostics: Turn diagnostic locations into hyperlinks. * 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 @@ macro-expansion time." (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) -- cgit 1.4.1