unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Mads Jensen <spam@raptus.dk>
Subject: font-lock problems
Date: 18 Sep 2005 12:50:20 +0200	[thread overview]
Message-ID: <87y85uk5ub.fsf@madamex.madamex.dk> (raw)

Hi NG,

I am trying to get font-lock to color some words, but I am not having
very much luck doing it. I am using regexp-opt for creating a list of
words to colorize. The code, that I am using is this:

<code>
(defface inducks-keyword-face
  '((t (:foreground "green"))) "face for inducks fields")

(defvar inducks-keywords (regexp-opt '("aka" "altcode" "anim" "app"
		"art" "artdir" "background" "brokpg" "cast" "changes"
		"chardesign" "code" "col" "collecting" "comment"
		"country" "date" "desc" "desc" "dir" "distrib" "edit"
		"effectsanim" "enddate" "entrycode" "equiv" "fly"
		"genre" "hero" "hiddencomm" "idc" "includedin"
		"includes" "ink" "internal" "inx" "issdate" "isslang"
		"issuecode" "issueseriescode" "issuevolumecode" "lang"
		"layout" "let" "level" "max" "missing" "music" "names"
		"orderer" "origpg" "owner" "pagel" "pages" "part" "plot"
		"price" "prod" "pscode" "pubdate" "publ" "re" "rp-de"
		"rp-dk" "rp-fi" "rp-se" "ser" "size" "source"
		"story-comm" "storycode" "storyitem" "superref"
		"superrefd" "tim" "title" "titlepref" "trans" "voices"
		"westernl" "writ" "xapp" "xref" "xrefd" "desc-fi"
		"desc-da" "desc-se" "desc-no" "desc-it" "desc-ru"
		"desc-nl" "desc-de") 'words) "inducks keywords to
		colorize")

(font-lock-add-keywords 'inducks-mode 
			'(("slam" . 'font-lock-comment-face)))

(font-lock-add-keywords 'inducks-mode 
			'(((concat 
			    "\\<\\(" inducks-keywords "\\)\\>") 
			   . 'inducks-keyword-face)))
</code>

The "slam" is not being colorized either. This is part of a major mode,
I am writing. Thank you very much in advance,
-- 
Mads Jensen - mail sent to address ends in /dev/null
              s/spam/madsj for emailing me 
              gpg: 7E775BDA

It is impossible to make anything foolproof because fools are so
ingenious.

             reply	other threads:[~2005-09-18 10:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-18 10:50 Mads Jensen [this message]
2005-09-19 14:09 ` font-lock problems Stefan Monnier
2005-09-19 16:07   ` Mads Jensen
2005-09-20  9:25     ` Tim X
2005-09-21  2:34     ` Stefan Monnier
2005-09-19 22:39 ` rgb

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=87y85uk5ub.fsf@madamex.madamex.dk \
    --to=spam@raptus.dk \
    /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).