guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Colorized REPL


From: Nala Ginrut
Subject: Re: [PATCH] Colorized REPL
Date: Mon, 31 Dec 2012 16:29:58 +0800

I have the honor to release this patch for colorized-REPL.
For a brief description about (ice-9 colorized) module, I listed them
below:
1. colorized-REPL feature:
Add two lines to your ~/.guile, to enable colorized-REPL feature: 
(use-modules (ice-9 colorized))
(activate-colorized)

2. custom color scheme:
Example:
(add-color-scheme! `((,(lambda (data) 
                        (and (number? data) (> data 10000)))
                        MY-LONG-NUM ,color-it (RED))))
Add it to your ~/.guile or in your code at you wish.
This feature is useful, because sometimes we need to test our program
and output a colorful result for some monitoring purpose.
PS: MY-LONG-NUM is an arbitrary name for your own color scheme, as you
like.

3. colored string/display:
(string-in-color "hello" '(BLUE BOLD))
==>  "\x1b[34;1mhello\x1b[0m"
(display-in-color "hello" '(BLUE BOLD))
* is the same with (display (string-in-color ...)) *

Please review it ASAP, thanks!

Happy Hacking!

Attachment: 0001-Add-new-feture-colorized-REPL-and-color-string-outpu.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]