From 0876e9c116125b28806286b0313ff78de5948562 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 25 Sep 2019 10:45:38 +0200 Subject: colors: Add 'dim'. * guix/colors.scm (coloring-procedure): New procedure. (%highlight-color): Remove. (highlight): Define in terms of 'coloring-procedure'. (dim): New procedure. --- guix/colors.scm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/guix/colors.scm b/guix/colors.scm index 7949cf5763..b63ac37027 100644 --- a/guix/colors.scm +++ b/guix/colors.scm @@ -31,6 +31,8 @@ colorize-string highlight + dim + color-rules color-output? isatty?*)) @@ -133,14 +135,16 @@ that subsequent output will not have any colors in effect." (not (getenv "NO_COLOR")) (isatty?* port))) -(define %highlight-color (color BOLD)) +(define (coloring-procedure color) + "Return a procedure that applies COLOR to the given string." + (lambda* (str #:optional (port (current-output-port))) + "Return STR with extra ANSI color attributes if PORT supports it." + (if (color-output? port) + (colorize-string str color) + str))) -(define* (highlight str #:optional (port (current-output-port))) - "Return STR with extra ANSI color attributes to highlight it if PORT -supports it." - (if (color-output? port) - (colorize-string str %highlight-color) - str)) +(define highlight (coloring-procedure (color BOLD))) +(define dim (coloring-procedure (color DARK))) (define (colorize-matches rules) "Return a procedure that, when passed a string, returns that string -- cgit v1.2.3 m class='right' method='get' action='/guix/log/gnu/tests.scm'>
path: root/gnu/tests.scm
AgeCommit message (Collapse)Author
2020-07-25utils: Move <location> and '&error-location' to (guix diagnostics).Ludovic Courtès
* guix/utils.scm (<location>, source-properties->location) (location->source-properties, &error-location): Move to... * guix/diagnostics.scm: ... here. * gnu.scm: Adjust imports accordingly. * gnu/machine.scm: Likewise. * gnu/system.scm: Likewise. * gnu/tests.scm: Likewise. * guix/inferior.scm: Likewise. * tests/channels.scm: Likewise. * tests/packages.scm: Likewise.
2020-03-05tests: Add <system-test> gexp compiler.Ludovic Courtès
* gnu/tests.scm (compile-system-test): New gexp compiler.
2020-01-23tests: Fix typo in comment.Ludovic Courtès
* gnu/tests.scm: Add missing word in commentary.