[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/07: ui: Add 'file-hyperlink'.
From: |
guix-commits |
Subject: |
04/07: ui: Add 'file-hyperlink'. |
Date: |
Thu, 28 Nov 2019 07:31:30 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit fa983b825748bedb795a8105fad53c8548ca57d3
Author: Ludovic Courtès <address@hidden>
Date: Thu Nov 28 13:08:49 2019 +0100
ui: Add 'file-hyperlink'.
* guix/ui.scm (file-hyperlink): New procedure.
(location->hyperlink): Use it.
---
guix/ui.scm | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/guix/ui.scm b/guix/ui.scm
index 12611cb..afa6d94 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -111,6 +111,7 @@
package-specification->name+version+output
supports-hyperlinks?
+ file-hyperlink
location->hyperlink
relevance
@@ -1255,6 +1256,13 @@ documented at
(and (isatty?* port)
(not (getenv "INSIDE_EMACS"))))
+(define* (file-hyperlink file #:optional (text file))
+ "Return TEXT with escapes for a hyperlink to FILE."
+ (hyperlink (string-append "file://" (gethostname)
+ (encode-and-join-uri-path
+ (string-split file #\/)))
+ text))
+
(define (location->hyperlink location)
"Return a string corresponding to LOCATION, with escapes for a hyperlink."
(let ((str (location->string location))
@@ -1262,10 +1270,7 @@ documented at
(location-file location)
(search-path %load-path (location-file location)))))
(if file
- (hyperlink (string-append "file://" (gethostname)
- (encode-and-join-uri-path
- (string-split file #\/)))
- str)
+ (file-hyperlink file str)
str)))
(define* (package->recutils p port #:optional (width (%text-width))
- branch master updated (e8c6644 -> 62e7864), guix-commits, 2019/11/28
- 01/07: doc: Handle right arrows in 'syntax-highlighted-html'., guix-commits, 2019/11/28
- 06/07: services: Add pam-mount., guix-commits, 2019/11/28
- 07/07: doc: Link to Guile's SXML section., guix-commits, 2019/11/28
- 05/07: ui: 'display-generation' emits a hyperlink for the generation., guix-commits, 2019/11/28
- 02/07: substitute: 'http-multiple-get' no longer drops requests above 1, 000., guix-commits, 2019/11/28
- 04/07: ui: Add 'file-hyperlink'.,
guix-commits <=
- 03/07: services: nginx: Add description., guix-commits, 2019/11/28