[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: glitches with font-lock-add-keywords
From: |
ken |
Subject: |
Re: glitches with font-lock-add-keywords |
Date: |
Mon, 05 Jun 2006 17:54:07 -0400 |
User-agent: |
Mozilla Thunderbird 1.0 (X11/20041207) |
martin rudalics wrote:
>> (defvar my-extra-keywords
>> '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
>> ("\\<\\(XXX\\|xxx\\|???\\|(sp?)\\)\\>" . font-lock-keyword-face)))
>>
>> The strings "XXX" and "xxx" are the only ones which are colorized at
>> all, showing up as magenta. I would like all of them to be something
>> more striking, like lime-green. Is there a table or some sort of
>> "translation" which can be used to determine what actual color names
>> correspond to vars like "font-lock-warning-face" and
>> "font-lock-keyword"? Or, better, can actual color names be used
>> instead, and if so, where would I find a table or listing of them?
>
> (defface my-extra-face '((t (:foreground "LimeGreen")))
> "My extra face. Pick your favorite group on the next line."
> :group 'basic-faces)
>
>> Secondly: None of the strings containing a '?' are colorized at all
>> (they're just black, the same as "normal" text); I understand that '?'
>> is a special character in elisp and so requires some minor syntactical
>> gymnastics to induce emacs to treat it as a regular character. So what
>> is the syntax I should use for that here?
>
> Assuming that the question mark is a symbol constituent and "(" and ")"
> are open and close parenthesis characters you can try:
>
> (defvar my-extra-keywords
> '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
> ("\\<\\(XXX\\|xxx\\)\\>\\|\\_<\\(\\?\\?\\?\\)\\_>\\|(sp\\?)" .
> 'my-extra-face)))
Thanks, Martin,
The LimeGreen is showing up and the "sp?" inside of "(sp?)". I'm
thinking that the "()" chars are being overwritten by other, blue
highlighting. I changed the last line above to:
("\\<\\(XXX\\|xxx\\)\\>\\|\\_<\\(\\?\\?\\?\\)\\_>\\|(\\(sp\\?\\))" .
'my-extra-face)))
because I don't want the last three chars of "What's lisp?" to be
highlighted, but only "(sp?)". So all of that is fine.
However, "???" is not being highlighted. There's a lot of characters
clustered around the "???"... I'm wondering if they're all supposed to
be there....
Again, I just want ??? to be highlighted, not _<(???)>_ or anything like
that... just "???".
Thanks for any solutions.
--
As a statistic, the US Unemployment Rate is like saying that no one is
drowning because the flood waters have risen only five inches today.