Hi,

I wanted to modify Alex' irc client so that I could have some text printed 
color. (I prefer the American spelling "color", as that is what’s used in 
computer tech.)
I therefor wrote the following:

(setq *ColorTerm (car (member (sys "TERM") '("linux" "xterm" "xterm-color" 
"xterm-256color" "rxvt"))))

(de useColor (C . Prog)
        (when *ColorTerm (call 'tput 'setaf C))
        (run Prog)
        (when *ColorTerm (call 'tput 'sgr0)) )

Here’s how you may use it to print two lines in green (2):

(useColor 2
        (prinl "On this system, *ColorTerm is " *ColorTerm)
        (prinl "That should be fine") )

You may find more info on ANSI colors here:
<http://en.wikipedia.org/wiki/ANSI_escape_code#Colors>

As I just got hold of Alex’ very latest version of the irc client, I see no 
point in making my old modified version available right now.

See his article here: <http://picolisp.com/wiki/?ircClient>

/Jon--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to