From: ken <gebser@speakeasy.net>
Subject: Re: glitches with font-lock-add-keywords
Date: Mon, 05 Jun 2006 17:54:07 -0400 [thread overview]
Message-ID: <4484A7FF.7090708@speakeasy.net> (raw)
In-Reply-To: <4483D436.1070105@gmx.at>
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.
next prev parent reply other threads:[~2006-06-05 21:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-05 6:50 glitches with font-lock-add-keywords martin rudalics
2006-06-05 21:54 ` ken [this message]
2006-06-06 6:38 ` martin rudalics
2006-06-06 12:49 ` glitches with font-lock-add-keywords -- SOLVED ken
2006-06-06 3:10 ` glitches with font-lock-add-keywords Johan Bockgård
-- strict thread matches above, loose matches on Subject: below --
2006-06-03 11:33 ken
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=4484A7FF.7090708@speakeasy.net \
--to=gebser@speakeasy.net \
--cc=help-gnu-emacs@gnu.org \
/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).