Lisp HUG Maillist Archive

Outputting coloured text

Hello,

Does anyone know of a simple way to change the colour of text output to the Listener?

For example, I want the call:

(format t “This is a red word.”)

to print the sentence with the word “red” in red.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Outputting coloured text

See hcl:write-string-with-properties

http://www.lispworks.com/documentation/lw71/LW/html/lw-714.htm

You'll also need to look at editor:make-face to get colors.

John DeSoi, Ph.D.


> On Jul 10, 2020, at 2:54 AM, David Johnson-Davies <david@interface.co.uk> wrote:
> 
> Does anyone know of a simple way to change the colour of text output to the Listener?
> 
> For example, I want the call:
> 
> (format t “This is a red word.”)
> 
> to print the sentence with the word “red” in red.


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Outputting coloured text

Hi John, Mark,

Thanks for the help! I’ve verified that this works:

(write-string-with-properties "Hello" '(:highlight :compiler-error-highlight))

Now I need to understand make-face.

Regards,
David

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Updated at: 2020-12-10 08:28 UTC