help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: preparing colored text


From: Kai Großjohann
Subject: Re: preparing colored text
Date: Thu, 03 Apr 2003 15:37:51 +0200
User-agent: Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.3.50 (gnu/linux)

jaepstein_63@yahoo.com (Jonathan Epstein) writes:

>  (with-output-to-temp-buffer "*ColorExample*"
>       (save-excursion
>       (set-buffer standard-output)
>       (setq truncate-lines t)
>       (insert "here is some sample red text, green text, and flowery blue
> prose")
>       (put-text-property 20 29 'face 'font-lock-warning-face)
>       (put-text-property 31 42 'face 'font-lock-type-face)
>       (put-text-property 47 65 'face 'font-lock-function-name-face)
>       )) 

(insert (propertize "warning" 'face 'font-lock-warning-face))

... easier to maintain in case the strings change :-)

-- 
A preposition is not a good thing to end a sentence with.


reply via email to

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