From patchwork Mon Feb 17 13:40:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Neidhardt X-Patchwork-Id: 20298 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9805C27BBE4; Mon, 17 Feb 2020 13:41:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 1A6BD17B91 for ; Mon, 17 Feb 2020 13:41:09 +0000 (GMT) Received: from localhost ([::1]:45706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3ge4-0001Il-JC for patchwork@mira.cbaines.net; Mon, 17 Feb 2020 08:41:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55995) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3gdz-0001HU-4H for guix-patches@gnu.org; Mon, 17 Feb 2020 08:41:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3gdy-0007xy-1x for guix-patches@gnu.org; Mon, 17 Feb 2020 08:41:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60417) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3gdx-0007xu-Vp for guix-patches@gnu.org; Mon, 17 Feb 2020 08:41:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j3gdx-0002N2-Sy for guix-patches@gnu.org; Mon, 17 Feb 2020 08:41:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39642] [PATCH 1/3] ui: Only display link in capable terminals. Resent-From: Pierre Neidhardt Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Feb 2020 13:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39642 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39642@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15819468369066 (code B ref -1); Mon, 17 Feb 2020 13:41:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Feb 2020 13:40:36 +0000 Received: from localhost ([127.0.0.1]:38157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3gdY-0002MA-Ht for submit@debbugs.gnu.org; Mon, 17 Feb 2020 08:40:36 -0500 Received: from lists.gnu.org ([209.51.188.17]:57393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3gdW-0002M2-9p for submit@debbugs.gnu.org; Mon, 17 Feb 2020 08:40:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55925) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3gdV-00018o-34 for guix-patches@gnu.org; Mon, 17 Feb 2020 08:40:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3gdT-0007iJ-Br for guix-patches@gnu.org; Mon, 17 Feb 2020 08:40:32 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:59083) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j3gdT-0007gX-58 for guix-patches@gnu.org; Mon, 17 Feb 2020 08:40:31 -0500 X-Originating-IP: 92.169.129.147 Received: from bababa.home (lfbn-idf2-1-1315-147.w92-169.abo.wanadoo.fr [92.169.129.147]) (Authenticated sender: mail@ambrevar.xyz) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 04501E0004 for ; Mon, 17 Feb 2020 13:40:27 +0000 (UTC) From: Pierre Neidhardt Date: Mon, 17 Feb 2020 14:40:27 +0100 Message-Id: <20200217134027.731-1-mail@ambrevar.xyz> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From: zimoun * guix/ui.scm (display-generation): Display generation path on new line. * guix/scripts/describe.scm (channel-commit-hyperlink): Add TRANSFORMER argument. (display-profile-content): Use TRANSFORMER argument to display URL explicitly when terminal does not support hyperlinks. --- guix/scripts/describe.scm | 16 ++++++++++++---- guix/ui.scm | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm index f13f221da9..9a7bd52163 100644 --- a/guix/scripts/describe.scm +++ b/guix/scripts/describe.scm @@ -201,7 +201,12 @@ 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. @@ -233,9 +238,12 @@ way and displaying details about the channel's source code." (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 is a procedure of 2 arguments, a URI and text, and returns a +string for display." (let* ((url (channel-url channel)) (uri (string->uri url)) (host (and uri (uri-host uri)))) @@ -244,7 +252,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))) diff --git a/guix/ui.scm b/guix/ui.scm index dce97fb7b9..7e3251446f 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1636,7 +1636,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 From patchwork Mon Feb 17 13:42:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Neidhardt X-Patchwork-Id: 20299 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 259FA27BBE4; Mon, 17 Feb 2020 13:43:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id ED14817A7E for ; Mon, 17 Feb 2020 13:43:10 +0000 (GMT) Received: from localhost ([::1]:45728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3gg2-0001i8-HW for patchwork@mira.cbaines.net; Mon, 17 Feb 2020 08:43:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56356) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3gfu-0001hv-R2 for guix-patches@gnu.org; Mon, 17 Feb 2020 08:43:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3gft-0000d2-U1 for guix-patches@gnu.org; Mon, 17 Feb 2020 08:43:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60429) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3gft-0000cx-Qy for guix-patches@gnu.org; Mon, 17 Feb 2020 08:43:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j3gft-0002Qh-Od for guix-patches@gnu.org; Mon, 17 Feb 2020 08:43:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39642] [PATCH 2/3] ui: Don't disable colors when INSIDE_EMACS is set. References: <20200217134027.731-1-mail@ambrevar.xyz> In-Reply-To: <20200217134027.731-1-mail@ambrevar.xyz> Resent-From: Pierre Neidhardt Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Feb 2020 13:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39642 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39642@debbugs.gnu.org Received: via spool by 39642-submit@debbugs.gnu.org id=B39642.15819469709313 (code B ref 39642); Mon, 17 Feb 2020 13:43:01 +0000 Received: (at 39642) by debbugs.gnu.org; 17 Feb 2020 13:42:50 +0000 Received: from localhost ([127.0.0.1]:38167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3gfi-0002Q6-2v for submit@debbugs.gnu.org; Mon, 17 Feb 2020 08:42:50 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:43911) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3gfg-0002Ps-8O for 39642@debbugs.gnu.org; Mon, 17 Feb 2020 08:42:48 -0500 Received: from bababa.home (lfbn-idf2-1-1315-147.w92-169.abo.wanadoo.fr [92.169.129.147]) (Authenticated sender: mail@ambrevar.xyz) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 9A2D024000A for <39642@debbugs.gnu.org>; Mon, 17 Feb 2020 13:42:46 +0000 (UTC) From: Pierre Neidhardt Date: Mon, 17 Feb 2020 14:42:45 +0100 Message-Id: <20200217134246.2312-1-mail@ambrevar.xyz> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/colors.scm (color-output?): Remove INSIDE_EMACS condition. --- guix/colors.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/guix/colors.scm b/guix/colors.scm index b63ac37027..3031f54799 100644 --- a/guix/colors.scm +++ b/guix/colors.scm @@ -131,8 +131,7 @@ that subsequent output will not have any colors in effect." (define (color-output? port) "Return true if we should write colored output to PORT." - (and (not (getenv "INSIDE_EMACS")) - (not (getenv "NO_COLOR")) + (and (not (getenv "NO_COLOR")) (isatty?* port))) (define (coloring-procedure color) From patchwork Mon Feb 17 13:42:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Neidhardt X-Patchwork-Id: 20300 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5CFA427BBE4; Mon, 17 Feb 2020 13:43:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 1E02117B91 for ; Mon, 17 Feb 2020 13:43:11 +0000 (GMT) Received: from localhost ([::1]:45730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3gg2-0001iJ-Lb for patchwork@mira.cbaines.net; Mon, 17 Feb 2020 08:43:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56365) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3gfv-0001hw-8v for guix-patches@gnu.org; Mon, 17 Feb 2020 08:43:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3gfu-0000dH-9m for guix-patches@gnu.org; Mon, 17 Feb 2020 08:43:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3gfu-0000dC-6v for guix-patches@gnu.org; Mon, 17 Feb 2020 08:43:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j3gfu-0002Qo-5l for guix-patches@gnu.org; Mon, 17 Feb 2020 08:43:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39642] [PATCH 3/3] ui: Don't truncate search output when inside Emacs. Resent-From: Pierre Neidhardt Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Feb 2020 13:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39642 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39642@debbugs.gnu.org Received: via spool by 39642-submit@debbugs.gnu.org id=B39642.15819469709319 (code B ref 39642); Mon, 17 Feb 2020 13:43:02 +0000 Received: (at 39642) by debbugs.gnu.org; 17 Feb 2020 13:42:50 +0000 Received: from localhost ([127.0.0.1]:38169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3gfi-0002Q9-CO for submit@debbugs.gnu.org; Mon, 17 Feb 2020 08:42:50 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:36917) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3gfg-0002Pt-AK for 39642@debbugs.gnu.org; Mon, 17 Feb 2020 08:42:49 -0500 Received: from bababa.home (lfbn-idf2-1-1315-147.w92-169.abo.wanadoo.fr [92.169.129.147]) (Authenticated sender: mail@ambrevar.xyz) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 01093240006 for <39642@debbugs.gnu.org>; Mon, 17 Feb 2020 13:42:46 +0000 (UTC) From: Pierre Neidhardt Date: Mon, 17 Feb 2020 14:42:46 +0100 Message-Id: <20200217134246.2312-2-mail@ambrevar.xyz> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200217134246.2312-1-mail@ambrevar.xyz> References: <20200217134246.2312-1-mail@ambrevar.xyz> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/ui.scm (display-search-results): Loop over all results when INSIDE_EMACS is set. --- guix/ui.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/ui.scm b/guix/ui.scm index 7e3251446f..77e538ccfb 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1472,7 +1472,8 @@ them. If PORT is a terminal, print at most a full screen of results." #:hyperlinks? links? #:extra-fields `((relevance . ,score))))))) - (if (and max-rows + (if (and (not (getenv "INSIDE_EMACS")) + max-rows (> (port-line port) first-line) ;print at least one result (> (+ 4 (line-count text) (port-line port)) max-rows))