Revert "ui: Only display link in capable terminals."

This reverts commit d7545a6b53.

The commit led to a test failure in 'tests/guix-package-net.sh'.  It
also led to disagreements discussed here:

  https://lists.gnu.org/archive/html/guix-devel/2020-02/msg00353.html

Reverting until these are addressed.
This commit is contained in:
Ludovic Courtès 2020-02-28 00:03:34 +01:00
parent 71c3c3df92
commit c2f9ea2b50
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 5 additions and 12 deletions

View file

@ -201,11 +201,7 @@ (define (display-profile-content profile number)
(format #t (G_ " commit: ~a~%") (format #t (G_ " commit: ~a~%")
(if (supports-hyperlinks?) (if (supports-hyperlinks?)
(channel-commit-hyperlink channel commit) (channel-commit-hyperlink channel commit)
commit)) commit))))
(when (not (supports-hyperlinks?))
(format #t (G_ " URL: ~a~%")
(channel-commit-hyperlink channel commit
(lambda (url msg) url))))))
(_ #f))) (_ #f)))
;; Show most recently installed packages last. ;; Show most recently installed packages last.
@ -237,12 +233,9 @@ (define %vcs-web-views
(define* (channel-commit-hyperlink channel (define* (channel-commit-hyperlink channel
#:optional #:optional
(commit (channel-commit channel)) (commit (channel-commit channel)))
(transformer hyperlink))
"Return a hyperlink for COMMIT in CHANNEL, using COMMIT as the hyperlink's "Return a hyperlink for COMMIT in CHANNEL, using COMMIT as the hyperlink's
text. The hyperlink links to a web view of COMMIT, when available. text. The hyperlink links to a web view of COMMIT, when available."
TRANSFORMER is a procedure of 2 arguments, a URI and text, and returns a
string for display."
(let* ((url (channel-url channel)) (let* ((url (channel-url channel))
(uri (string->uri url)) (uri (string->uri url))
(host (and uri (uri-host uri)))) (host (and uri (uri-host uri))))
@ -251,7 +244,7 @@ (define* (channel-commit-hyperlink channel
(#f (#f
commit) commit)
((_ template) ((_ template)
(transformer (template url commit) commit))) (hyperlink (template url commit) commit)))
commit))) commit)))

View file

@ -1638,7 +1638,7 @@ (define (display-generation profile number)
(let* ((file (generation-file-name profile number)) (let* ((file (generation-file-name profile number))
(link (if (supports-hyperlinks?) (link (if (supports-hyperlinks?)
(cut file-hyperlink file <>) (cut file-hyperlink file <>)
(cut format #f (G_ "~a~%file: ~a") <> file))) identity))
(header (format #f (link (highlight (G_ "Generation ~a\t~a"))) (header (format #f (link (highlight (G_ "Generation ~a\t~a")))
number number
(date->string (date->string