From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antis Lathoi Newsgroups: gmane.emacs.help Subject: Re: How to customize the face of echo area messages? Date: Tue, 4 Jan 2011 03:06:12 -0800 (PST) Organization: http://groups.google.com Message-ID: <02844946-6155-4591-bbb4-7b2c2a656962@w29g2000vba.googlegroups.com> References: <546808c5-7160-4732-b8f6-b1d0d5d5e4c3@j25g2000vbs.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1294141279 410 80.91.229.12 (4 Jan 2011 11:41:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 Jan 2011 11:41:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 04 12:41:15 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pa5GN-00073t-KN for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Jan 2011 12:41:15 +0100 Original-Received: from localhost ([127.0.0.1]:40830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pa5GM-0000wM-RQ for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Jan 2011 06:41:14 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!w29g2000vba.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-NNTP-Posting-Host: 178.83.138.150 Original-X-Trace: posting.google.com 1294139172 1738 127.0.0.1 (4 Jan 2011 11:06:12 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 4 Jan 2011 11:06:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w29g2000vba.googlegroups.com; posting-host=178.83.138.150; posting-account=X5LNsAoAAADTxXfqvFeeRopYOgPyYM4K User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101211 Gentoo Firefox/3.6.13,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:183958 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78160 Archived-At: On 2 Jan., 19:08, "Drew Adams" wrote: > > (defun my-msg (msg &optional face) > =A0 "`message', but with text using FACE (default `highlight')." > =A0 (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). =A0You could advise `message' to catch most of th= ose. > Something like this: > > (defadvice message (around my-message-advice activate) > =A0 "Show the message using face `font-lock-warning-face'." > =A0 (ad-set-args > =A0 =A0 0 (list (propertize > =A0 =A0 =A0 =A0 =A0 =A0 =A0 (apply #'format (ad-get-args 0)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'face 'font-lock-warning-face)= )) > =A0 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