all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.