unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: extronom <extronom@googlemail.com>
To: help-gnu-emacs@gnu.org
Subject: set face for added font lock keywords
Date: Sun, 9 Jan 2011 07:27:30 -0800 (PST)	[thread overview]
Message-ID: <865aa6b0-9ca4-4b98-8b41-ecc8c245e84d@r29g2000yqj.googlegroups.com> (raw)

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


             reply	other threads:[~2011-01-09 15:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-09 15:27 extronom [this message]
2011-01-10  5:31 ` set face for added font lock keywords Suvayu Ali
2011-01-10  5:34   ` Suvayu Ali
2011-01-10  6:43 ` Teemu Likonen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=865aa6b0-9ca4-4b98-8b41-ecc8c245e84d@r29g2000yqj.googlegroups.com \
    --to=extronom@googlemail.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.
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).