[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apply faces to string output to mini-buffer
From: |
Miguel Guedes |
Subject: |
Re: Apply faces to string output to mini-buffer |
Date: |
24 May 2013 08:38:13 GMT |
User-agent: |
Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) |
On Fri, 24 May 2013 09:40:50 +0200, Stephen Berman wrote:
>
> The function `message' returns the printed representation of the
> message, so when you evaluate it in the minibuffer, this return value
> overwrites the propertized message, which is displayed in the echo area
> (which coincides with the minibuffer) as a side effect (on my machine I
> can see it briefly before it is overwritten). If you embed the message
> sexp in another function, it returns to the caller, so it doesn't
> overwrite the propertized message in the echo area. E.g., if you
> evaluate this:
>
> (defun my-foo ()
> (interactive)
> (message "%s" (propertize "foo" 'face '(:foreground "red"))))
>
> and then type `M-x my-foo', you'll see a red "foo" (without quotes) in
> the echo area.
I would never have got that. Thank you for the explanation & solution,
Stephen!
--
Miguel