From: "sandro.dentella" <sandro@e-den.it>
Subject: changing precedence in font-lock-add-keywords
Date: 22 Nov 2006 06:36:04 -0800 [thread overview]
Message-ID: <1164206164.086152.236680@f16g2000cwb.googlegroups.com> (raw)
Hi,
i'm trying to customize a mode for cheetah templating system, it is
derived from html-mode and seems pretty simple:
(define-derived-mode cheetah-mode html-mode "Cheetah"
(make-face 'cheetah-variable-face)
(font-lock-add-keywords
nil
'(
("\\(#\\(end \\)?\\(include.*\\|block.*\\|import\\|load\\)\\)" 1
font-lock-builtin-face)
("\\(##.*\\)" 1 font-lock-comment-face)
("\\(#\\*.*\\*#\\)" 1 font-lock-comment-face)
("\\(#\\(from\\|else\\|set\\|import\\|for\\|if\\|end\\)+\\)\\>" 1
font-lock-keyword-face)
("\\(<%.*%>\\)" 1 font-lock-keyword-face)
;;
("\\(#\\(from\\|for\\|end\\)\\).*\\<\\(for\\|import\\|if\\|in\\)\\>" 3
font-lock-keyword-face)
("\\(\\$\\(?:\\sw\\|}\\|{\\|\\s_\\)+\\)" 1
font-lock-variable-name-face)
))
(font-lock-mode 1)
)
what I'd like to optain is that the regexp defined here take precedence
over those defined in html-mode. As an example the line with <% %> gets
colored as it would in html but i'd like it to show as a keyword.
Any hints?
TIA
sandro
*:-)
next reply other threads:[~2006-11-22 14:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-22 14:36 sandro.dentella [this message]
2006-11-23 17:36 ` changing precedence in font-lock-add-keywords Robert Thorpe
2006-11-24 21:22 ` Dieter Wilhelm
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=1164206164.086152.236680@f16g2000cwb.googlegroups.com \
--to=sandro@e-den.it \
/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).