[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/07: ui: Move 'location->hyperlink' to (guix diagnostics).
From: |
guix-commits |
Subject: |
06/07: ui: Move 'location->hyperlink' to (guix diagnostics). |
Date: |
Fri, 8 Apr 2022 18:01:04 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 3da62bf5aa358667621c8c390c755c5bfa45a93f
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Apr 1 15:41:00 2022 +0200
ui: Move 'location->hyperlink' to (guix diagnostics).
* guix/ui.scm (location->hyperlink): Move to...
* guix/diagnostics.scm: ... here.
* guix/scripts/system/search.scm: Adjust imports accordingly.
---
guix/diagnostics.scm | 11 +++++++++++
guix/scripts/system/search.scm | 1 +
guix/ui.scm | 12 ------------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/guix/diagnostics.scm b/guix/diagnostics.scm
index 337a73c1a2..2b8cee1ccb 100644
--- a/guix/diagnostics.scm
+++ b/guix/diagnostics.scm
@@ -39,6 +39,7 @@
source-properties->location
location->source-properties
location->string
+ location->hyperlink
&error-location
error-location?
@@ -259,6 +260,16 @@ a location object."
(($ <location> file line column)
(format #f "~a:~a:~a" file line column))))
+(define (location->hyperlink location)
+ "Return a string corresponding to LOCATION, with escapes for a hyperlink."
+ (let ((str (location->string location))
+ (file (if (string-prefix? "/" (location-file location))
+ (location-file location)
+ (search-path %load-path (location-file location)))))
+ (if file
+ (file-hyperlink file str)
+ str)))
+
(define-condition-type &error-location &error
error-location?
(location error-location)) ;<location>
diff --git a/guix/scripts/system/search.scm b/guix/scripts/system/search.scm
index ff2ea7652c..93c9fc5644 100644
--- a/guix/scripts/system/search.scm
+++ b/guix/scripts/system/search.scm
@@ -21,6 +21,7 @@
#:use-module (guix ui)
#:use-module (guix utils)
#:autoload (guix colors) (supports-hyperlinks?)
+ #:autoload (guix diagnostics) (location->hyperlink)
#:use-module (gnu services)
#:use-module (gnu services shepherd)
#:use-module (srfi srfi-1)
diff --git a/guix/ui.scm b/guix/ui.scm
index 6f2fe62784..37d24030e4 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -118,8 +118,6 @@
package->recutils
package-specification->name+version+output
- location->hyperlink
-
pager-wrapped-port
with-paginated-output-port
relevance
@@ -1484,16 +1482,6 @@ followed by \"+ \", which makes for a valid multi-line
field value in the
'()
str)))
-(define (location->hyperlink location)
- "Return a string corresponding to LOCATION, with escapes for a hyperlink."
- (let ((str (location->string location))
- (file (if (string-prefix? "/" (location-file location))
- (location-file location)
- (search-path %load-path (location-file location)))))
- (if file
- (file-hyperlink file str)
- str)))
-
(define* (package->recutils p port #:optional (width (%text-width))
#:key
(hyperlinks? (supports-hyperlinks? port))
- branch master updated (20645d8467 -> 13307c198b), guix-commits, 2022/04/08
- 02/07: doc: Build an empty index if the manual is missing., guix-commits, 2022/04/08
- 04/07: gnu: emacs-geiser: Add dependency on Project., guix-commits, 2022/04/08
- 01/07: doc: Allow different translations for 'guix-cookbook' and 'guix-manual'., guix-commits, 2022/04/08
- 03/07: gnu: lsof: Fix invalid G-Expression., guix-commits, 2022/04/08
- 06/07: ui: Move 'location->hyperlink' to (guix diagnostics).,
guix-commits <=
- 07/07: diagnostics: Turn diagnostic locations into hyperlinks., guix-commits, 2022/04/08
- 05/07: ui: Move hyperlink facilities to (guix colors)., guix-commits, 2022/04/08