unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Writing coloured text
@ 2022-11-16  8:53 Heime
  2022-11-16  9:37 ` Bruno Barbier
  0 siblings, 1 reply; 3+ messages in thread
From: Heime @ 2022-11-16  8:53 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

Am having problem writing coloured text with the following function.


(defun cmesg (mesg colr bufr)
  "TODO."

  (let ( (bfr (get-buffer-create bufr))
         (pms (propertize mesg
                          'face '(:foreground colr))) )
    (with-current-buffer bfr (insert pms))
    (display-buffer bfr)))



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Writing coloured text
  2022-11-16  8:53 Writing coloured text Heime
@ 2022-11-16  9:37 ` Bruno Barbier
  2022-11-16 13:29   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Bruno Barbier @ 2022-11-16  9:37 UTC (permalink / raw)
  To: Heime, Heime via Users list for the GNU Emacs text editor

Heime <heimeborgia@protonmail.com> writes:

> Am having problem writing coloured text with the following function.
>
>
> (defun cmesg (mesg colr bufr)
>   "TODO."
>
>   (let ( (bfr (get-buffer-create bufr))
>          (pms (propertize mesg
>                           'face '(:foreground colr))) )

'(:foreground colr)

=>

`(:foreground ,colr)




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Writing coloured text
  2022-11-16  9:37 ` Bruno Barbier
@ 2022-11-16 13:29   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2022-11-16 13:29 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Bruno Barbier <brubar.cs@gmail.com>
> Date: Wed, 16 Nov 2022 10:37:00 +0100
> 
> Heime <heimeborgia@protonmail.com> writes:
> 
> > (defun cmesg (mesg colr bufr)
> >   "TODO."
> >
> >   (let ( (bfr (get-buffer-create bufr))
> >          (pms (propertize mesg
> >                           'face '(:foreground colr))) )
> 
> '(:foreground colr)
> 
> =>
> 
> `(:foreground ,colr)

I think it is easier to understand this alternative:

  (list :foreground colr)




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-16 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16  8:53 Writing coloured text Heime
2022-11-16  9:37 ` Bruno Barbier
2022-11-16 13:29   ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).