[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glitches with font-lock-add-keywords

From: martin rudalics
Subject: Re: glitches with font-lock-add-keywords
Date: Mon, 05 Jun 2006 08:50:30 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> (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\\?)" . 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]