[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: font-lock on variables
From: |
Santiago Mejia |
Subject: |
Re: font-lock on variables |
Date: |
Sat, 25 Jul 2009 17:34:33 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Lennart Borgman <lennart.borgman@gmail.com> writes:
> On Fri, Jul 24, 2009 at 10:27 PM, Santiago Mejia<mejia@uchicago.edu> wrote:
>
> Look at how hi-lock.el does it.
I haven't really looked *inside* hi-lock.el yet. But I have tried using
the functions in hi-lock.el to highlight the words I am searching,
without any success. highligt-regexp, for example, works in most of my
buffers, but not in the buffers of the dictionaries I am trying to hack
(*wordnet* and *sdcv*)
Any idea as to why this happens? (I have, of course, turned off the
read-only behavior of the buffer)
In case this is helpful, the way these two modes fontify their output
buffers roughly in the same way. That is to say, first, they define
something like:
(defvar wordnet-font-lock-keywords
`(,(concat "^\\("
(regexp-opt '(
"Substance" "Part" "Meronyms" "Holonyms"
"Attributes" "Derived" "Domain" "Familiarity"
"Coordinate" "Grep" "Overview" "Similarity"
"Pertainyms"))
"\\).*")
(0 font-lock-keyword-face t t))
"Keywords to highlight in wordnet mode.")
And then, they call:
(setq font-lock-defaults '(wordnet-font-lock-keywords))
Thanks for any help.
Santiago.