From unknown Sun Jun 22 11:49:47 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54668] [PATCH 0/3] Turn diagnostic locations into hyperlinks Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Apr 2022 15:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54668 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54668@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164882524210676 (code B ref -1); Fri, 01 Apr 2022 15:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 1 Apr 2022 15:00:42 +0000 Received: from localhost ([127.0.0.1]:43040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naIlW-0002m8-5w for submit@debbugs.gnu.org; Fri, 01 Apr 2022 11:00:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:54004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naIlV-0002m1-2u for submit@debbugs.gnu.org; Fri, 01 Apr 2022 11:00:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naIlU-0003P0-1k for guix-patches@gnu.org; Fri, 01 Apr 2022 11:00:40 -0400 Received: from [2001:470:142:3::e] (port=54916 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naIlT-0005f2-FD; Fri, 01 Apr 2022 11:00:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=TofJde+npOFG+ewYV8PEZdqG+OV6+iWJk2YlBOO/kIs=; b=oZzJZE/s+UwPzy cNGlz6H0ePck+w3+tcSGLcHLyg6JqjVO2TkRanlL3JiHzIWz+zxaK5D/mSknNPNF88Eh8lWtq97Dk joQo7mu8RffT6604s9JMZtk0u+/pfQf0SwCBzWMx3uu5z6RNrPHIR5zF0oy2+24vL58/I88QJ9NUo LVva++sYWTe3F6/WHvI4XbBfzvJQOQn0pu+UOtfMru4azMZuiuI6FtCqnC/F14QnlgvuYE4LI8QoY ULTK6dWvVEnpdUHqfWeroRTSIl55BkCIURwPu9o8USeY1T2cYiGcDy4I+OBhDL+962CrZQvgJbYUu CQKuPUHsNW5doqVOMs1A==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=38736 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naIky-0008WI-LW; Fri, 01 Apr 2022 11:00:37 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 1 Apr 2022 16:59:55 +0200 Message-Id: <20220401145955.32347-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Guix! This patch series shuffles things around and turns diagnostic locations into hyperlinks. That is, on terminals that support it (GNOME Terminal, Terminology, Kitty, etc.¹), every time you see, say: gnu/packages/foo.scm:300:42: warning: something's wrong … the location prefix is now clickable. I did not reexport the bindings moved to (guix diagnostics). To authors of software that uses Guix (GWL in particular), lemme know if that’s a problem! Ludo’. ¹ For some reasons xfce4-terminal no longer supports it; I think it used to. Ludovic Courtès (3): ui: Move hyperlink facilities to (guix colors). ui: Move 'location->hyperlink' to (guix diagnostics). diagnostics: Turn diagnostic locations into hyperlinks. guix/colors.scm | 35 +++++++++++++++++++++++++++++- guix/diagnostics.scm | 16 +++++++++++++- guix/scripts/home.scm | 1 + guix/scripts/system.scm | 1 + guix/scripts/system/search.scm | 4 +++- guix/ui.scm | 39 ---------------------------------- 6 files changed, 54 insertions(+), 42 deletions(-) base-commit: fc94e93c4b60addfda3c1eddfb85907e9459a8af -- 2.34.0 From unknown Sun Jun 22 11:49:47 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54668] [PATCH 1/3] ui: Move hyperlink facilities to (guix colors). References: <20220401145955.32347-1-ludo@gnu.org> In-Reply-To: <20220401145955.32347-1-ludo@gnu.org> Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Apr 2022 15:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54668 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54668@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54668-submit@debbugs.gnu.org id=B54668.164882532410885 (code B ref 54668); Fri, 01 Apr 2022 15:03:01 +0000 Received: (at 54668) by debbugs.gnu.org; 1 Apr 2022 15:02:04 +0000 Received: from localhost ([127.0.0.1]:43053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naImp-0002pQ-GV for submit@debbugs.gnu.org; Fri, 01 Apr 2022 11:02:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naImn-0002oY-Cn for 54668@debbugs.gnu.org; Fri, 01 Apr 2022 11:02:01 -0400 Received: from [2001:470:142:3::e] (port=54944 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naImi-0005tA-4D; Fri, 01 Apr 2022 11:01:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=o9Y9mhSe6+jgIV/RfzgHZ2JB99LVQmbg3CNXwXucQ2w=; b=NEs9znv4wMNNgk NHyU3Oi0j2v2LD5bz+Qb036nz/3/KW4oX5F6oQk30rcY7lPP1uMdAXTCFdoZJuqwE6ds0aOYo0rSu pGQf3fMpBJWFYSKzyNo2jskcCHAT8IkrFxfo9AFT0b16SXcG3tMcmx7v5hrnI6YuPonSH1gWRm3i7 Bu1dxfVFc0HxJcjWhTmBgXxLkDCt+UBkMi9eqdm3nROhj9ze0JB/aV7/94/lPvvH0ym+AKNdqKhhr KZ/kHihvzib8HKHC7P04Dl5/Hp0tsjaZSl8LprL19mwTHcljgjCcuvUnifeBRehBmu2ptZ7Ku5ryG gvGZzlwMcuCb9PT9vE2w==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=38740 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naImh-0005LG-Nw; Fri, 01 Apr 2022 11:01:55 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 1 Apr 2022 17:01:44 +0200 Message-Id: <20220401150146.32529-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * guix/ui.scm (supports-hyperlinks?, file-hyperlink, hyperlink): Move to... * guix/colors.scm: ... here. * guix/scripts/home.scm, guix/scripts/system.scm, guix/scripts/system/search.scm: Adjust imports accordingly. --- guix/colors.scm | 35 +++++++++++++++++++++++++++++++++- guix/scripts/home.scm | 1 + guix/scripts/system.scm | 1 + guix/scripts/system/search.scm | 3 ++- guix/ui.scm | 27 -------------------------- 5 files changed, 38 insertions(+), 29 deletions(-) diff --git a/guix/colors.scm b/guix/colors.scm index ae0a583d94..2b3a7c9032 100644 --- a/guix/colors.scm +++ b/guix/colors.scm @@ -26,6 +26,7 @@ (define-module (guix colors) #:use-module (srfi srfi-9 gnu) #:use-module (ice-9 match) #:use-module (ice-9 regex) + #:autoload (web uri) (encode-and-join-uri-path) #:export (color color? @@ -36,7 +37,11 @@ (define-module (guix colors) color-rules color-output? - isatty?*)) + isatty?* + + supports-hyperlinks? + file-hyperlink + hyperlink)) ;;; Commentary: ;;; @@ -191,3 +196,31 @@ (define-syntax color-rules ((_ (regexp colors ...) ...) (colorize-matches `((,(make-regexp regexp) ,(color colors) ...) ...))))) + + +;;; +;;; Hyperlinks. +;;; + +(define (hyperlink uri text) + "Return a string that denotes a hyperlink using an OSC escape sequence as +documented at +." + (string-append "\x1b]8;;" uri "\x1b\\" + text "\x1b]8;;\x1b\\")) + +(define* (supports-hyperlinks? #:optional (port (current-output-port))) + "Return true if PORT is a terminal that supports hyperlink escapes." + ;; Note that terminals are supposed to ignore OSC escapes they don't + ;; understand (this is the case of xterm as of version 349, for instance.) + ;; However, Emacs comint as of 26.3 does not ignore it and instead lets it + ;; through, hence the 'INSIDE_EMACS' special case below. + (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)) diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index af2643014d..341d83943d 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -45,6 +45,7 @@ (define-module (guix scripts home) #:use-module (guix channels) #:use-module (guix derivations) #:use-module (guix ui) + #:autoload (guix colors) (supports-hyperlinks? file-hyperlink) #:use-module (guix grafts) #:use-module (guix packages) #:use-module (guix profiles) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 067bf999f1..73e3c299c1 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -29,6 +29,7 @@ (define-module (guix scripts system) #:use-module (guix config) #:use-module (guix ui) + #:autoload (guix colors) (supports-hyperlinks? file-hyperlink) #:use-module ((guix status) #:select (with-status-verbosity)) #:use-module (guix store) #:autoload (guix base16) (bytevector->base16-string) diff --git a/guix/scripts/system/search.scm b/guix/scripts/system/search.scm index bf49ea2341..ff2ea7652c 100644 --- a/guix/scripts/system/search.scm +++ b/guix/scripts/system/search.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2017-2019, 2022 Ludovic Courtès ;;; Copyright © 2018 Clément Lassieur ;;; ;;; This file is part of GNU Guix. @@ -20,6 +20,7 @@ (define-module (guix scripts system search) #:use-module (guix ui) #:use-module (guix utils) + #:autoload (guix colors) (supports-hyperlinks?) #: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 6c194eb3c9..6f2fe62784 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -76,7 +76,6 @@ (define-module (guix ui) #:autoload (ice-9 popen) (open-pipe* close-pipe) #:autoload (system repl repl) (start-repl) #:autoload (system repl debug) (make-debug stack->vector) - #:autoload (web uri) (encode-and-join-uri-path) #:use-module (texinfo) #:use-module (texinfo plain-text) #:use-module (texinfo string-utils) @@ -119,9 +118,6 @@ (define-module (guix ui) package->recutils package-specification->name+version+output - supports-hyperlinks? - hyperlink - file-hyperlink location->hyperlink pager-wrapped-port @@ -1488,29 +1484,6 @@ (define (string->recutils str) '() str))) -(define (hyperlink uri text) - "Return a string that denotes a hyperlink using an OSC escape sequence as -documented at -." - (string-append "\x1b]8;;" uri "\x1b\\" - text "\x1b]8;;\x1b\\")) - -(define* (supports-hyperlinks? #:optional (port (current-output-port))) - "Return true if PORT is a terminal that supports hyperlink escapes." - ;; Note that terminals are supposed to ignore OSC escapes they don't - ;; understand (this is the case of xterm as of version 349, for instance.) - ;; However, Emacs comint as of 26.3 does not ignore it and instead lets it - ;; through, hence the 'INSIDE_EMACS' special case below. - (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)) -- 2.34.0 From unknown Sun Jun 22 11:49:47 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54668] [PATCH 2/3] ui: Move 'location->hyperlink' to (guix diagnostics). Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Apr 2022 15:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54668 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54668@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54668-submit@debbugs.gnu.org id=B54668.164882532410892 (code B ref 54668); Fri, 01 Apr 2022 15:03:01 +0000 Received: (at 54668) by debbugs.gnu.org; 1 Apr 2022 15:02:04 +0000 Received: from localhost ([127.0.0.1]:43055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naImq-0002pW-3Z for submit@debbugs.gnu.org; Fri, 01 Apr 2022 11:02:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naImo-0002oZ-2R for 54668@debbugs.gnu.org; Fri, 01 Apr 2022 11:02:02 -0400 Received: from [2001:470:142:3::e] (port=54946 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naImi-0005tf-Op; Fri, 01 Apr 2022 11:01:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=hVegxZiF76OrAkfB6Ve+trkVS5caVaJ+szK0zurSDFg=; b=kzgAzbFp307nYunyAzcq EmX6K6phH7wSYvM9Onim1axhRsBYXNNdDkxWWpxA45KVklTnIAeK3NdxbFa+zeJ6iGx/yp8QqfYYo CX6iNDZvwVSK6sREbbFpwrtudoWIzfclZMOTB4vxy5V6bA+UcqFNf5uUgLGfYwq6VILT/ZYAEdNzx 9myysEYU/J9xpFFOTP+EMWltLR4/cMl0FEX1gLPC9dIEF+dUlx8LhU7OIXIy/LoPqjblTWAzN0mVj /fX+ziVjren0S/RkW0buBGN03vjKJ2alRaR2fTPcPyZ3UW3QAKtocuyWKStEupnckh6mrORXncOZo 1NL+APWH26UIVQ==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=38740 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naImi-0005LG-Bj; Fri, 01 Apr 2022 11:01:56 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 1 Apr 2022 17:01:45 +0200 Message-Id: <20220401150146.32529-2-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220401150146.32529-1-ludo@gnu.org> References: <20220401150146.32529-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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 @@ (define-module (guix diagnostics) source-properties->location location->source-properties location->string + location->hyperlink &error-location error-location? @@ -259,6 +260,16 @@ (define (location->string loc) (($ 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)) ; 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 @@ (define-module (guix scripts system search) #: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 @@ (define-module (guix ui) package->recutils package-specification->name+version+output - location->hyperlink - pager-wrapped-port with-paginated-output-port relevance @@ -1484,16 +1482,6 @@ (define (string->recutils str) '() 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)) -- 2.34.0 From unknown Sun Jun 22 11:49:47 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54668] [PATCH 3/3] diagnostics: Turn diagnostic locations into hyperlinks. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Apr 2022 15:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54668 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54668@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54668-submit@debbugs.gnu.org id=B54668.164882532410898 (code B ref 54668); Fri, 01 Apr 2022 15:03:02 +0000 Received: (at 54668) by debbugs.gnu.org; 1 Apr 2022 15:02:04 +0000 Received: from localhost ([127.0.0.1]:43057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naImq-0002pd-GT for submit@debbugs.gnu.org; Fri, 01 Apr 2022 11:02:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naImo-0002od-Ky for 54668@debbugs.gnu.org; Fri, 01 Apr 2022 11:02:02 -0400 Received: from [2001:470:142:3::e] (port=54948 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naImj-0005uM-C9; Fri, 01 Apr 2022 11:01:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=t2nOHOuCrjPcN/1u0JP7Nhz51Y+XNnAyLNAScfRluvE=; b=FunJ22EqKb2zb6a07TdV dyY9vFbL8S1w+lI9R5GI6dLEJYDcclvxp2mB+ckTOffmf1ewqWGVUJ8B7lSCuj1FCpxj4TgxJ0JT+ pKcIoLhKdSBiJjD1M3GN6B5561ogxNCZYhFOnQRr5kUnJm23jlTfNunmYDuXB7NheJgolRvJvFumI WBYGsr8XPnUd1tCMlc/AXALJV3EiY6h3AnuYS8Suri+XuSFmM0qNmy8h6iejrdfXLqzAsBwac7W8H Fg5F1xfGlNxZ9siJcNDcg3oshSPQv7C2GRti3Pt8FZx7a9WJZLF58N66BtGlY8Hh3Iakvf1rKKqr1 CtnHgjV2yD/dJg==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=38740 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naImi-0005LG-VW; Fri, 01 Apr 2022 11:01:57 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 1 Apr 2022 17:01:46 +0200 Message-Id: <20220401150146.32529-3-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220401150146.32529-1-ludo@gnu.org> References: <20220401150146.32529-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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 @@ (define prefix-color (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) -- 2.34.0 From unknown Sun Jun 22 11:49:47 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54668] [PATCH 1/3] ui: Move hyperlink facilities to (guix colors). Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Apr 2022 15:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54668 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 54668@debbugs.gnu.org Received: via spool by 54668-submit@debbugs.gnu.org id=B54668.164882786915203 (code B ref 54668); Fri, 01 Apr 2022 15:45:01 +0000 Received: (at 54668) by debbugs.gnu.org; 1 Apr 2022 15:44:29 +0000 Received: from localhost ([127.0.0.1]:43203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naJRs-0003x8-S9 for submit@debbugs.gnu.org; Fri, 01 Apr 2022 11:44:29 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:45056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naJRq-0003wz-3f for 54668@debbugs.gnu.org; Fri, 01 Apr 2022 11:44:27 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id DTkQ270074UW6Th01TkQMX; Fri, 01 Apr 2022 17:44:24 +0200 Message-ID: From: Maxime Devos Date: Fri, 01 Apr 2022 17:44:18 +0200 In-Reply-To: <20220401150146.32529-1-ludo@gnu.org> References: <20220401145955.32347-1-ludo@gnu.org> <20220401150146.32529-1-ludo@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-/dk6cBxfkLZnxxXBI85T" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1648827864; bh=91qEFaBChCvRjVOYcLECfQ1eq18iJVhHZL5UPBmnD7Y=; h=Subject:From:To:Date:In-Reply-To:References; b=LQ931/yife85RaVVTzzZa940onvWdqKgQnh7ib1Eo1wDWQg4hAl0+f/Ax52PqD05p W1dgJ/euuq3T1MpuCaXfkmmwk8ylM8c6XLBh8An1t8wKpZ0LVcemKNRk3mio3dQGOG n98B5Sz7YlNfjbMjWgK6IS/qwzWPIvnJscO+MONEbv7DNi8nulQ8F6K08nC4tB6RMh MHZG1NnezP+HMwrb1oKlDXoC7EXbSPj2VvSnBUW9k6ryAIkfAxlXyz7/Hm+dzZqGRN rCJv9RdMXiWjThQhdYmg+zspOHoIUZ1MVgT9Bewaix20uxxzwuBxmd9cnmjKK/4Kn/ d7q/abbnnMpRQ== X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-/dk6cBxfkLZnxxXBI85T Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op vr 01-04-2022 om 17:01 [+0200]: >=20 > +(define (hyperlink uri text) > +=C2=A0 "Return a string that denotes a hyperlink using an OSC escape seq= uence as > +documented at > +." > +=C2=A0 (string-append "\x1b]8;;" uri "\x1b\\" > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 text "\x1b]8;;\x1b\\")) What if 'uri' contains the character #\x1b, e.g. "file://home/foo/\x15.scm"? Does it need to be escaped? Greetings, Maxime. --=-/dk6cBxfkLZnxxXBI85T Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkcd0xccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hVuAP4znvOQukfjIHEQcjdoPMcXwf13 lhOoC+YUYRimCkX45wEAviElGomxOS1+aCvJa9pdPLJGtCRotXv2rQ0GKlITNQ0= =BrZx -----END PGP SIGNATURE----- --=-/dk6cBxfkLZnxxXBI85T-- From unknown Sun Jun 22 11:49:47 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54668] [PATCH 0/3] Turn diagnostic locations into hyperlinks Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 04 Apr 2022 12:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54668 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 54668@debbugs.gnu.org Received: via spool by 54668-submit@debbugs.gnu.org id=B54668.1649074221766 (code B ref 54668); Mon, 04 Apr 2022 12:11:02 +0000 Received: (at 54668) by debbugs.gnu.org; 4 Apr 2022 12:10:21 +0000 Received: from localhost ([127.0.0.1]:50722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbLXI-0000CI-Sg for submit@debbugs.gnu.org; Mon, 04 Apr 2022 08:10:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbLXI-0000C6-1h for 54668@debbugs.gnu.org; Mon, 04 Apr 2022 08:10:20 -0400 Received: from [2001:470:142:3::e] (port=58940 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbLXC-0003Uy-4p; Mon, 04 Apr 2022 08:10:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=aIVX4Lb+QzocyREJ0rXjd8d3E3JHojX8x77LPmHWS6s=; b=JOWPp/awYaE0D9FCZiL7 zBWvQrOdZYRtkkHhzDiTy40Rmn9KQPPXVX7RFQXet/pNyCzc+5fZhJOErhT/Dh9FG5uxH8d9buawW bjRBuOR/+UUQ7UmCH4k5zS8rCqAE54SrU7oZAFNf3t4UJv8Domtga+vByIgm6q09EBpzUBuNvCnb2 NINUolbYi3Vh9xPdJyrOpR6ePo9eZQgnueXb67ThoDEqUYQbPdQbXBF3MX2gxSY51l+9qhibRxsxb IAjijrhYnJrJi58QjweC/Hm5PoVaEm8Z3uwa+mAzLCCbKbV+Re8h/G7clDquAEipYMj8XnwdyGIYT Uy6AU6Qb5W187g==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56209 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbLXB-0005Uy-44; Mon, 04 Apr 2022 08:10:13 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220401145955.32347-1-ludo@gnu.org> <20220401150146.32529-1-ludo@gnu.org> Date: Mon, 04 Apr 2022 14:10:10 +0200 In-Reply-To: (Maxime Devos's message of "Fri, 01 Apr 2022 17:44:18 +0200") Message-ID: <875ynpuk0t.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Maxime Devos skribis: > Ludovic Court=C3=A8s schreef op vr 01-04-2022 om 17:01 [+0200]: >>=20 >> +(define (hyperlink uri text) >> +=C2=A0 "Return a string that denotes a hyperlink using an OSC escape se= quence as >> +documented at >> +." >> +=C2=A0 (string-append "\x1b]8;;" uri "\x1b\\" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 text "\x1b]8;;\x1b\\")) (This code was already there.) > What if 'uri' contains the character #\x1b, e.g. > "file://home/foo/\x15.scm"? Does it need to be escaped? Good question. I checked the spec linked above and it reads: URI is the target of the hyperlink in URI-encoded form. So I guess we should pass =E2=80=98uri=E2=80=99 through =E2=80=98uri-encode= =E2=80=99. I=E2=80=99ll do that in a separate patch. Thanks, Ludo=E2=80=99. From unknown Sun Jun 22 11:49:47 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#54668: closed (Re: bug#54668: [PATCH 0/3] Turn diagnostic locations into hyperlinks) Message-ID: References: <87tub38c9k.fsf_-_@gnu.org> <20220401145955.32347-1-ludo@gnu.org> X-Gnu-PR-Message: they-closed 54668 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 54668@debbugs.gnu.org Date: Fri, 08 Apr 2022 22:03:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1649455382-11672-1" This is a multi-part message in MIME format... ------------=_1649455382-11672-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #54668: [PATCH 0/3] Turn diagnostic locations into hyperlinks which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 54668@debbugs.gnu.org. --=20 54668: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D54668 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1649455382-11672-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 54668-done) by debbugs.gnu.org; 8 Apr 2022 22:02:26 +0000 Received: from localhost ([127.0.0.1]:36246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncwgU-00030Z-1O for submit@debbugs.gnu.org; Fri, 08 Apr 2022 18:02:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncwgS-0002wC-NU for 54668-done@debbugs.gnu.org; Fri, 08 Apr 2022 18:02:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48116) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncwgM-0001xD-DC; Fri, 08 Apr 2022 18:02:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=xAWqlTKLCj81vrqtPLduADn4oSkUhc4iRMwHjqM8zdg=; b=KkA17n7y+OY+DzOJo478 2+Wj5LKvtqGSFYy4DBsFAtakcvRAsyBG1Rnrr+ZiYz5yHCgiYnczCl4YaRFGatQBjpDuJreezj/Yr aQIH3MkRQz6rc4xesnYh8QojKobt/zzeak+x4I0OlfBMipkKoMAeKNCj+UzzRpoOXcbSAFIlO1kCX f3pIdibzlk+lQA9pHaw/W7PSF/McankxfxOdkOk+lZgjwcnq1avl1WE3yPk8ct4ihfDtfa/HGHz49 I+lflU3zwFg8TlMJZ15J5hIrxrOcy7HEctyFshChc0fQ8QIqRBT86MiXAGrMfmqH1HLqy4qT0uK/O WlNd1ajzLBP/Ew==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:52233 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncwgM-0003W7-0x; Fri, 08 Apr 2022 18:02:18 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxime Devos Subject: Re: bug#54668: [PATCH 0/3] Turn diagnostic locations into hyperlinks References: <20220401145955.32347-1-ludo@gnu.org> <20220401150146.32529-1-ludo@gnu.org> <875ynpuk0t.fsf_-_@gnu.org> Date: Sat, 09 Apr 2022 00:02:15 +0200 In-Reply-To: <875ynpuk0t.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Mon, 04 Apr 2022 14:10:10 +0200") Message-ID: <87tub38c9k.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54668-done Cc: 54668-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Pushed as 13307c198bcd1fbd9364bcb7ef4c6d19d287cf2c! Ludovic Court=C3=A8s skribis: > Maxime Devos skribis: > >> Ludovic Court=C3=A8s schreef op vr 01-04-2022 om 17:01 [+0200]: >>>=20 >>> +(define (hyperlink uri text) >>> +=C2=A0 "Return a string that denotes a hyperlink using an OSC escape s= equence as >>> +documented at >>> +." >>> +=C2=A0 (string-append "\x1b]8;;" uri "\x1b\\" >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 text "\x1b]8;;\x1b\\")) > > (This code was already there.) > >> What if 'uri' contains the character #\x1b, e.g. >> "file://home/foo/\x15.scm"? Does it need to be escaped? > > Good question. I checked the spec linked above and it reads: > > URI is the target of the hyperlink in URI-encoded form. > > So I guess we should pass =E2=80=98uri=E2=80=99 through =E2=80=98uri-enco= de=E2=80=99. I=E2=80=99ll do that in a > separate patch. Actually this is already done by =E2=80=98file-hyperlink=E2=80=99 a few lin= es below, so we=E2=80=99re fine. Thanks, Ludo=E2=80=99. ------------=_1649455382-11672-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 1 Apr 2022 15:00:42 +0000 Received: from localhost ([127.0.0.1]:43040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naIlW-0002m8-5w for submit@debbugs.gnu.org; Fri, 01 Apr 2022 11:00:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:54004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naIlV-0002m1-2u for submit@debbugs.gnu.org; Fri, 01 Apr 2022 11:00:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naIlU-0003P0-1k for guix-patches@gnu.org; Fri, 01 Apr 2022 11:00:40 -0400 Received: from [2001:470:142:3::e] (port=54916 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naIlT-0005f2-FD; Fri, 01 Apr 2022 11:00:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=TofJde+npOFG+ewYV8PEZdqG+OV6+iWJk2YlBOO/kIs=; b=oZzJZE/s+UwPzy cNGlz6H0ePck+w3+tcSGLcHLyg6JqjVO2TkRanlL3JiHzIWz+zxaK5D/mSknNPNF88Eh8lWtq97Dk joQo7mu8RffT6604s9JMZtk0u+/pfQf0SwCBzWMx3uu5z6RNrPHIR5zF0oy2+24vL58/I88QJ9NUo LVva++sYWTe3F6/WHvI4XbBfzvJQOQn0pu+UOtfMru4azMZuiuI6FtCqnC/F14QnlgvuYE4LI8QoY ULTK6dWvVEnpdUHqfWeroRTSIl55BkCIURwPu9o8USeY1T2cYiGcDy4I+OBhDL+962CrZQvgJbYUu CQKuPUHsNW5doqVOMs1A==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=38736 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naIky-0008WI-LW; Fri, 01 Apr 2022 11:00:37 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 0/3] Turn diagnostic locations into hyperlinks Date: Fri, 1 Apr 2022 16:59:55 +0200 Message-Id: <20220401145955.32347-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Guix! This patch series shuffles things around and turns diagnostic locations into hyperlinks. That is, on terminals that support it (GNOME Terminal, Terminology, Kitty, etc.¹), every time you see, say: gnu/packages/foo.scm:300:42: warning: something's wrong … the location prefix is now clickable. I did not reexport the bindings moved to (guix diagnostics). To authors of software that uses Guix (GWL in particular), lemme know if that’s a problem! Ludo’. ¹ For some reasons xfce4-terminal no longer supports it; I think it used to. Ludovic Courtès (3): ui: Move hyperlink facilities to (guix colors). ui: Move 'location->hyperlink' to (guix diagnostics). diagnostics: Turn diagnostic locations into hyperlinks. guix/colors.scm | 35 +++++++++++++++++++++++++++++- guix/diagnostics.scm | 16 +++++++++++++- guix/scripts/home.scm | 1 + guix/scripts/system.scm | 1 + guix/scripts/system/search.scm | 4 +++- guix/ui.scm | 39 ---------------------------------- 6 files changed, 54 insertions(+), 42 deletions(-) base-commit: fc94e93c4b60addfda3c1eddfb85907e9459a8af -- 2.34.0 ------------=_1649455382-11672-1-- From unknown Sun Jun 22 11:49:47 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#54668] [PATCH 0/3] Turn diagnostic locations into hyperlinks Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 09 Apr 2022 09:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54668 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 54668-done@debbugs.gnu.org Received: via spool by 54668-done@debbugs.gnu.org id=D54668.16494964629488 (code D ref 54668); Sat, 09 Apr 2022 09:28:01 +0000 Received: (at 54668-done) by debbugs.gnu.org; 9 Apr 2022 09:27:42 +0000 Received: from localhost ([127.0.0.1]:36738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nd7Ne-0002Sy-41 for submit@debbugs.gnu.org; Sat, 09 Apr 2022 05:27:42 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:46258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nd7Nc-0002Sq-C4 for 54668-done@debbugs.gnu.org; Sat, 09 Apr 2022 05:27:40 -0400 Received: from [192.168.109.254] ([188.189.133.86]) by laurent.telenet-ops.be with bizsmtp id GZTe2700B1s0Pjw01ZTesn; Sat, 09 Apr 2022 11:27:39 +0200 Message-ID: <574b1752ae3f2b03c019d3028153bb7587ad5468.camel@telenet.be> From: Maxime Devos Date: Sat, 09 Apr 2022 11:27:38 +0200 In-Reply-To: <87tub38c9k.fsf_-_@gnu.org> References: <20220401145955.32347-1-ludo@gnu.org> <20220401150146.32529-1-ludo@gnu.org> <875ynpuk0t.fsf_-_@gnu.org> <87tub38c9k.fsf_-_@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-5G/f2fEXfH3uhGzi8h27" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1649496459; bh=y3vY029t2HVZf2madLrgF7N7JSUzcuQilRTgh2Y9rPM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=IEo3PuVzknO1eZvapvXzeUWz6wqrY0hpTPYDjE3L0x1pNKGHS6ZuNNikDAocM+JeL Vsi5SFMGJCI7sjPJzrXkNAv/gT3Er4Hve0t6i2iAjlEXm28Dc5/0G2O8TKIhGxkhEa wdS71qA9UBboj5h+eQB1L+xGsBPRy8F/wtdJEiVe3bpLFs0d/whZTOGZqsBBpucB95 tbH6TIW3Ch8E3Fa8eZog2iH93ks2udfBtaoJY4WTNvJ1UPqa/PGgeVBbpMtLOS9Zct LsiedYcNHLhCtMtH3gyomqiG4T61yUu04EmKlpf7QFB+eVm63zeu0PqiveeGS1GgsA yv2GSPUd0MuXA== X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-5G/f2fEXfH3uhGzi8h27 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op za 09-04-2022 om 00:02 [+0200]: > > So I guess we should pass =E2=80=98uri=E2=80=99 through =E2=80=98uri-en= code=E2=80=99.=C2=A0 I=E2=80=99ll do that > > in a > > separate patch. >=20 > Actually this is already done by =E2=80=98file-hyperlink=E2=80=99 a few l= ines > below, so we=E2=80=99re fine. FWIW, (guix ui) doesn't seem to do this for license links: ((? license? license) (let ((text (license-name license)) (uri (license-uri license))) (if (and hyperlinks? uri (string-prefix? "http" uri)) (hyperlink uri text) text))) Likewise for (guix scripts describe), though it might not be a problem there yet given the limited set of URIs. I think it's a bit less fragile to move the uri-encoding from 'file- hyperlink' to 'hyperlink', WDYT? Greetings, Maxime. --=-5G/f2fEXfH3uhGzi8h27 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYlFRihccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7icgAP4vGtGtqtQo03bwpKSDvLTweZiI M0a0zOYyoCE+yd0kbgD9FSEpspVSkUsCkm1qm0vXbYix5frT0IjFai24m4xPtgM= =GxYP -----END PGP SIGNATURE----- --=-5G/f2fEXfH3uhGzi8h27--