all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Antis Lathoi <antis.lathoi@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to customize the face of echo area messages?
Date: Tue, 4 Jan 2011 03:06:12 -0800 (PST)	[thread overview]
Message-ID: <02844946-6155-4591-bbb4-7b2c2a656962@w29g2000vba.googlegroups.com> (raw)
In-Reply-To: mailman.3.1293991776.23049.help-gnu-emacs@gnu.org

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


      parent reply	other threads:[~2011-01-04 11:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-02 14:07 How to customize the face of echo area messages? Antis Lathoi
2011-01-02 18:08 ` Drew Adams
     [not found] ` <mailman.3.1293991776.23049.help-gnu-emacs@gnu.org>
2011-01-04 11:06   ` Antis Lathoi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02844946-6155-4591-bbb4-7b2c2a656962@w29g2000vba.googlegroups.com \
    --to=antis.lathoi@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.