From: Jason Plew
Subject: Help with Displaying Colored Text?
Date: 
Message-ID: <b1b25a0f.0212062115.5e7cecbd@posting.google.com>
I've rather new to lisp - am running CLISP inside a Linux Terminal.
What I was wondering is if there is any way to have the a LISP program
display colored text on the screen. Any help would be greatly
appreciated. Thanks.

Jason Plew

From: Tim Daly, Jr.
Subject: Re: Help with Displaying Colored Text?
Date: 
Message-ID: <wk3cpae6al.fsf@tenkan.org>
·····@yahoo.com (Jason Plew) writes:

> I've rather new to lisp - am running CLISP inside a Linux Terminal.
> What I was wondering is if there is any way to have the a LISP program
> display colored text on the screen. Any help would be greatly
> appreciated. Thanks.
> 
> Jason Plew


I believe that you can use the ANSI escape sequences to change colors
in most Linux terminals.  I'm sure that Google can tell you what the
various escape sequences are.  

In lisp, character literals are prefixed with an octothorp-backslash,
so if you want to write the character 'p' in your program, you type
'#\p'.  Troublesome characters usually have a mnemonic which works
too, like #\Newline and #\Escape.  This gives us a way to put the ANSI
escape sequences into a program:

  (defconstant ansi-red 
     (coerce #(#\escape #\[ #\0 #\; #\3 #\1 #\m) 'string))

In this example, I've written out a vector of characters, then turned
it into a string, and saved it as the constant ANSI-RED.  Now, if you
print that constant, it should turn everything red:

  (print ansi-red)

I hope that's enough to have some fun with. :)

-Tim
From: Jason Plew
Subject: Re: Help with Displaying Colored Text?
Date: 
Message-ID: <b1b25a0f.0212080036.974e0aa@posting.google.com>
Worked Perfectly. Thanks for the help.

Jason Plew

···@tenkan.org (Tim Daly, Jr.) wrote in message news:<··············@tenkan.org>...
> ·····@yahoo.com (Jason Plew) writes:
> 
> > I've rather new to lisp - am running CLISP inside a Linux Terminal.
> > What I was wondering is if there is any way to have the a LISP program
> > display colored text on the screen. Any help would be greatly
> > appreciated. Thanks.
> > 
> > Jason Plew
> 
> 
> I believe that you can use the ANSI escape sequences to change colors
> in most Linux terminals.  I'm sure that Google can tell you what the
> various escape sequences are.  
> 
> In lisp, character literals are prefixed with an octothorp-backslash,
> so if you want to write the character 'p' in your program, you type
> '#\p'.  Troublesome characters usually have a mnemonic which works
> too, like #\Newline and #\Escape.  This gives us a way to put the ANSI
> escape sequences into a program:
> 
>   (defconstant ansi-red 
>      (coerce #(#\escape #\[ #\0 #\; #\3 #\1 #\m) 'string))
> 
> In this example, I've written out a vector of characters, then turned
> it into a string, and saved it as the constant ANSI-RED.  Now, if you
> print that constant, it should turn everything red:
> 
>   (print ansi-red)
> 
> I hope that's enough to have some fun with. :)
> 
> -Tim
From: Kalle Olavi Niemitalo
Subject: Re: Help with Displaying Colored Text?
Date: 
Message-ID: <877kekc3oy.fsf@Astalo.y2000.kon.iki.fi>
···@tenkan.org (Tim Daly, Jr.) writes:

> I believe that you can use the ANSI escape sequences to change colors
> in most Linux terminals.  I'm sure that Google can tell you what the
> various escape sequences are.  

For Linux specifically: man console_codes

More generally: <http://www.ecma.ch/ecma1/STAND/ECMA-048.HTM>
From: Marc Spitzer
Subject: Re: Help with Displaying Colored Text?
Date: 
Message-ID: <86n0niz6yw.fsf@bogomips.optonline.net>
·····@yahoo.com (Jason Plew) writes:

> I've rather new to lisp - am running CLISP inside a Linux Terminal.
> What I was wondering is if there is any way to have the a LISP program
> display colored text on the screen. Any help would be greatly
> appreciated. Thanks.

xemacs or emacs and ilisp.

marc

> 
> Jason Plew