unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* set face for added font lock keywords
@ 2011-01-09 15:27 extronom
  2011-01-10  5:31 ` Suvayu Ali
  2011-01-10  6:43 ` Teemu Likonen
  0 siblings, 2 replies; 4+ messages in thread
From: extronom @ 2011-01-09 15:27 UTC (permalink / raw)
  To: help-gnu-emacs

I'm trying to add some new keywords by doing  font-lock-add-keywords
so that a FIXME keyword gets highlighted, which works quite well. When
I try to change the color of the used face it doesn't work and
probably somebody could give me a hint what the problem is here (I'm
still a newbie regarding elisp programming).

Here is a function which is suppose to create a new buffer and add the
appropriated keyword regexp to be highlighted then but the color can't
be changed here it seems why? Maybe I'm missing some basic stuff here?

(defun my-new-buffer-color ()
  (interactive)
  (setq myBuffer (generate-new-buffer "myTemp"))
  (switch-to-buffer myBuffer)

  (lisp-interaction-mode)

  (font-lock-mode 0);; does not seem to help here???

  ;; this is supposed to work but doesn't???
  (set-face-foreground 'font-lock-comment-face "green" )
  (set-variable font-lock-comment-face 'font-lock-comment-face)

  ;; highlight FIXME
  (font-lock-add-keywords nil
    '("\\<FIXME\\>" 1 font-lock-comment-face prepend))

  (insert "this is a FIXME test \n")
)

Thanks for any help / hint.

Br


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

end of thread, other threads:[~2011-01-10  6:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-09 15:27 set face for added font lock keywords extronom
2011-01-10  5:31 ` Suvayu Ali
2011-01-10  5:34   ` Suvayu Ali
2011-01-10  6:43 ` Teemu Likonen

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