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

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

Re: C type fontification help


From: Stefan Monnier
Subject: Re: C type fontification help
Date: 19 May 2003 18:42:01 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> I need help fontifying "FOO(a)" as type and "bar" as variable below:
> struct foo {
>     FOO(a) bar;
> };
> I tried adding "FOO([^)]+)" to c-font-lock-extra-types but it
> doens't help because c-font-lock-extra-types doens't expect word
> delimiters.

You might want to try something like

  (add-hook 'c-mode-hook
    (lambda ()
      (set (make-local-variable 'font-lock-syntactic-keywords)
           '(("FOO([^)]+)" (0 '(2))))))

To first change the syntax-class of the open and close paren to "word".
That's pretty ugly but it should work (probably with some fiddling).


        Stefan


reply via email to

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