[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to customize the face of echo area messages?
From: |
Antis Lathoi |
Subject: |
Re: How to customize the face of echo area messages? |
Date: |
Tue, 4 Jan 2011 03:06:12 -0800 (PST) |
User-agent: |
G2/1.0 |
On 2 Jan., 19:08, "Drew Adams" <drew.ad...@oracle.com> wrote:
>
> (defun my-msg (msg &optional face)
> "`message', but with text using FACE (default `highlight')."
> (message (propertize msg 'face (or face 'highlight))))
>
> M-: (progn (my-msg "HELLO") (sleep-for 3))
> M-: (progn (my-msg "HELLO" 'font-lock-warning-face) (sleep-for 3))
>
> Of course, that only works for calls to `my-msg', not calls to `message' (such
> as what you described). You could advise `message' to catch most of those.
> Something like this:
>
> (defadvice message (around my-message-advice activate)
> "Show the message using face `font-lock-warning-face'."
> (ad-set-args
> 0 (list (propertize
> (apply #'format (ad-get-args 0))
> 'face 'font-lock-warning-face)))
> ad-do-it)
Thanks Drew!
that indeed works nicely with the exceptions you mentioned.
Didn't think that this customization would be so complicated. As
messages in the echo area are ubiquitious and therefore do a good deal
for the visual side of the emacs experience, I'm suprised you cannot
"customize" them (when you can nearly everything else :-)
thanks again
Antis