help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font-lock-comment-face not working in latest CVS


From: Kenneth Rose
Subject: Re: font-lock-comment-face not working in latest CVS
Date: Thu, 29 Jan 2004 07:51:03 GMT
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Gecko/20040113

Eli Zaretskii wrote:
From: Kenneth Rose <kenrose@rogers.com>
Newsgroups: gnu.emacs.help
Date: Tue, 27 Jan 2004 23:42:07 GMT

I downloaded the latest CVS sources and built emacs 21 for Mac OS X. When I loaded emacs, it started complaining because I had the line:

( set-face-foreground 'font-lock-comment-face "cyan" )

in my .emacs. It was complaining that font-lock-comment-face wasn't a valid face. However, if I opened my .emacs and evaluated the entire buffer (this is an option in the menu), the buffer evaluated fine and comments were in cyan. What's more, doing 'M-x set-face-foreground' and using tab completion showed me that font-lock-comment-face was a valid face.


The problem here is that font-lock-comment-face does not yet exist at
the point where set-face-foreground line from your .emacs is
evaluated.

The usual method to overcome that is to create the face with a call
to make-face just before that line.  Alternatively, figure out what
part of your .emacs causes font-lock to be loaded, and place the
set-face-foreground line after that.

Hmmm... the calls to set-face-foreground were made after a call to (global-font-lock-mode t) (which is where I believe font-lock-comment-face gets set). What's more, this .emacs works in 21.3 (on my GNU/Linux machine). It's only after building emacs from CVS to run on Mac OS X did the complaining start (version from CVS says 21.3.50.1).

Todah.

/<en


reply via email to

[Prev in Thread] Current Thread [Next in Thread]