all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* `message' function with propertized string
@ 2006-03-30 18:17 Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2006-03-30 18:17 UTC (permalink / raw)


The doc of function `message' says that its string argument(s) can have
`face' properties and these will affect the appearance of the message. From
the Emacs 22 ELisp manual:

     If STRING, or strings among the ARGUMENTS, have `face' text
     properties, these affect the way the message is displayed.

Can someone explain how to do use `message' to display a message with faces
showing on different parts of the string? I tried this:

(message (propertize "foobar toto" 'face 'highlight))

and this:

(setq foo "foobar toto")
(add-text-properties 0 (length foo) '(face highlight) foo)
(message foo)

But the message displayed didn't show the face. It just showed the write
syntax of a propertized string: #("foobar toto" 0 11 (face highlight))

What am I missing? (I've tried with a June 2005 CVS snapshot and also with
Emacs 21.3.1.)

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

* Re: `message' function with propertized string
       [not found] <mailman.186.1143742657.2481.help-gnu-emacs@gnu.org>
@ 2006-03-30 18:33 ` Johan Bockgård
  2006-03-30 18:42   ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Bockgård @ 2006-03-30 18:33 UTC (permalink / raw)


"Drew Adams" <drew.adams@oracle.com> writes:

> But the message displayed didn't show the face. It just showed the
> write syntax of a propertized string: #("foobar toto" 0 11 (face
> highlight))
>
> What am I missing?

The command you are using to evaluate the code is printing the result.
(Try M-x eval-region)

-- 
Johan Bockgård

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

* RE: `message' function with propertized string
  2006-03-30 18:33 ` `message' function with propertized string Johan Bockgård
@ 2006-03-30 18:42   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2006-03-30 18:42 UTC (permalink / raw)


    > But the message displayed didn't show the face. It just showed the
    > write syntax of a propertized string: #("foobar toto" 0 11 (face
    > highlight))
    >
    > What am I missing?
    
    The command you are using to evaluate the code is printing the result.
    (Try M-x eval-region)

Right. Thanks.

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

end of thread, other threads:[~2006-03-30 18:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.186.1143742657.2481.help-gnu-emacs@gnu.org>
2006-03-30 18:33 ` `message' function with propertized string Johan Bockgård
2006-03-30 18:42   ` Drew Adams
2006-03-30 18:17 Drew Adams

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.