Hi Ricardo,

On Tue, 4 Feb 2020 at 17:12, Ricardo Wurmus <rek...@elephly.net> wrote:

> > - Rename it to GUIX_INSIDE_EMACS?
> > - Document the existence of INSIDE_EMACS.
>
> The variable is set by Emacs.  As an Emacs feature we should not
> document it in Guix, nor should we rename it to GUIX_INSIDE_EMACS.

This is mitigated by foreign distro using bad packaged terminal, see e.g. [1].

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38940

And a couple of days, I was annoyed by this so I patched, see attached.


Note that 'guix system describe' has also the "issue" and do not use
the same function to display, I guess.


Otherwise, the OSC issue should be fixed by Emacs 27, I guess.
So the rename is probably not useful.



Cheers,
simon
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index cb1be989e1..408db70555 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -210,9 +210,11 @@ Download and deploy the latest version of Guix.\n"))
 
 (define* (channel-commit-hyperlink channel
                                    #:optional
-                                   (commit (channel-commit channel)))
+                                   (commit (channel-commit channel))
+                                   (transformer hyperlink))
   "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 allows to control how the uri and text are."
   (let* ((url  (channel-url channel))
          (uri  (string->uri url))
          (host (and uri (uri-host uri))))
@@ -221,7 +223,7 @@ text.  The hyperlink links to a web view of COMMIT, when available."
           (#f
            commit)
           ((_ template)
-           (hyperlink (template url commit) commit)))
+           (transformer (template url commit) commit)))
         commit)))
 
 (define* (display-profile-news profile #:key concise?
@@ -583,7 +585,11 @@ way and displaying details about the channel's source code."
                    (format #t (G_ "    commit: ~a~%")
                            (if (supports-hyperlinks?)
                                (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)))
 
             ;; Show most recently installed packages last.
diff --git a/guix/ui.scm b/guix/ui.scm
index 4857a88827..ee56c23362 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1625,7 +1625,7 @@ DURATION-RELATION with the current time."
     (let* ((file   (generation-file-name profile number))
            (link   (if (supports-hyperlinks?)
                        (cut file-hyperlink file <>)
-                       identity))
+                       (cut format #f (G_ "~a~%file: ~a") <> file)))
            (header (format #f (link (highlight (G_ "Generation ~a\t~a")))
                            number
                            (date->string

Reply via email to