unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* font-lock-comment-face not working in latest CVS
@ 2004-01-27 23:42 Kenneth Rose
  2004-01-28  6:55 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kenneth Rose @ 2004-01-27 23:42 UTC (permalink / raw)


Hey all,

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.

I fixed it by putting the change into a custom-set-faces

( custom-set-faces
    '(font-lock-comment-face       ((t (:foreground "cyan"))))
)

Does anyone know why my calls to set-face-foreground were causing errors?

Thanks.

/<en

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: font-lock-comment-face not working in latest CVS
  2004-01-27 23:42 font-lock-comment-face not working in latest CVS Kenneth Rose
@ 2004-01-28  6:55 ` Eli Zaretskii
       [not found] ` <mailman.1487.1075272863.928.help-gnu-emacs@gnu.org>
  2004-01-31 20:32 ` Kai Grossjohann
  2 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2004-01-28  6:55 UTC (permalink / raw)


> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: font-lock-comment-face not working in latest CVS
       [not found] ` <mailman.1487.1075272863.928.help-gnu-emacs@gnu.org>
@ 2004-01-29  7:51   ` Kenneth Rose
  2004-01-29 16:48     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Kenneth Rose @ 2004-01-29  7:51 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: font-lock-comment-face not working in latest CVS
  2004-01-29  7:51   ` Kenneth Rose
@ 2004-01-29 16:48     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2004-01-29 16:48 UTC (permalink / raw)


>>> 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:

Please M-x report-emacs-bug so it goes to the proper place.

> 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).

The problem is that in Emacs-CVS, calling global-font-lock-mode does not
load font-lock.el any more.  That could be considered as a bug in
Emacs-CVS indeed.


        Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: font-lock-comment-face not working in latest CVS
  2004-01-27 23:42 font-lock-comment-face not working in latest CVS Kenneth Rose
  2004-01-28  6:55 ` Eli Zaretskii
       [not found] ` <mailman.1487.1075272863.928.help-gnu-emacs@gnu.org>
@ 2004-01-31 20:32 ` Kai Grossjohann
  2 siblings, 0 replies; 5+ messages in thread
From: Kai Grossjohann @ 2004-01-31 20:32 UTC (permalink / raw)


Kenneth Rose <kenrose@rogers.com> writes:

> 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.

Put (require 'font-lock) before that line.

Kai

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-31 20:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-27 23:42 font-lock-comment-face not working in latest CVS Kenneth Rose
2004-01-28  6:55 ` Eli Zaretskii
     [not found] ` <mailman.1487.1075272863.928.help-gnu-emacs@gnu.org>
2004-01-29  7:51   ` Kenneth Rose
2004-01-29 16:48     ` Stefan Monnier
2004-01-31 20:32 ` Kai Grossjohann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).