From: kgold@watson.ibm.com (kgold)
Subject: Re: help with minor mode for word highlighting
Date: 4 Jan 2006 16:35:43 -0600 [thread overview]
Message-ID: <43bc4dbf$1@kcnews01> (raw)
In-Reply-To: mailman.19837.1135016930.20277.help-gnu-emacs@gnu.org
"perldev@monkeybytes.org" <perldev@monkeybytes.org> writes:
> I'm
> trying to write a very simple minor-mode for highlighting some words
> under text-mode. Here are the specifics of what would be great to see
> example code of:
>
> -- minor-mode skeleton to run alongside text-mode/paragraph-indent-
> minor-mode
> -- an example of creating a custom font-lock face for this mode
> -- an example of coloring a list of words using the custom face
> -- an example of coloring based on a regex
>
> That's it, really. No functions or specified indentation. I just want
> some special coloring on top of text-mode running paragraph-indent-
> minor-mode.
This isn't a minor mode, but here's what I did for log4j files:
(defface font-lock-fatal-face
'((((type tty) (class color)) (:foreground "red" ))
(t ))
"Font Lock mode face used to highlight fatal errors."
:group 'font-lock-highlighting-faces)
(define-generic-mode 'log4j-mode
'("#")
'("DEBUG")
'(
("INFO" . 'font-lock-constant-face)
("DEBUG" . 'font-lock-keyword-face)
("WARN" . 'font-lock-type-face)
("ERROR" . 'paren-face-mismatch)
("FATAL" . 'font-lock-fatal-face)
)
'(".log4j\\'")
nil
"Major mode for editing log4j logs")
--
Ken Goldman kgold@watson.ibm.com 914-784-7646
next prev parent reply other threads:[~2006-01-04 22:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.19837.1135016930.20277.help-gnu-emacs@gnu.org>
2005-12-21 0:42 ` help with minor mode for word highlighting gamename
2006-01-04 22:35 ` kgold [this message]
2005-12-19 18:01 perldev
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='43bc4dbf$1@kcnews01' \
--to=kgold@watson.ibm.com \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.