help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: problem understanding font-lock-defaults structure


From: Nikolaj Schumacher
Subject: Re: problem understanding font-lock-defaults structure
Date: Thu, 09 Oct 2008 13:13:40 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin)

Xah <xahlee@gmail.com> wrote:

> (setq myKeywordsLevel1
>  (quote
>    ("Sin\\|Cos" . font-lock-function-name-face)
>    ("π\\|∞" . font-lock-constant-face)
>    ("x\\|y" . font-lock-variable-name-face)
>  )
> )

It needs to be:

(setq myKeywordsLevel1
  (list
    ("Sin\\|Cos" . font-lock-function-name-face)
    ("π\\|∞" . font-lock-constant-face)
    ("x\\|y" . font-lock-variable-name-face)))

or

(setq myKeywordsLevel1
  (quote
    (("Sin\\|Cos" . font-lock-function-name-face)
     ("π\\|∞" . font-lock-constant-face)
     ("x\\|y" . font-lock-variable-name-face))))

> (setq font-lock-keywords
>  `(
>   ,myKeywordsLevel1
>  nil
>  nil
>  )
> )

There's no need to use `, here.  `font-lock-keywords' accepts symbols.

(setq font-lock-keywords '((myKeywordsLevel1 nil nil)))

or

(setq font-lock-keywords '(myKeywordsLevel1)

will work.

regards,
Nikolaj Schumacher




reply via email to

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