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

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

Re: How do I get emacs to highlight subroutine calls in c-mode.


From: Javier Oviedo
Subject: Re: How do I get emacs to highlight subroutine calls in c-mode.
Date: Mon, 13 Oct 2003 09:44:52 -0400

This is pretty cool. Could this be adapted to also work for calls through
function pointers? That would be quite nice!!

Example:
(*someStructure.someCallTable->someFunctionPointer)((void *)&test);


Thanks in advance!!

--
Javier


"jan" <janmar@iprimus.com.au> wrote in message
news:mailman.1544.1065932192.21628.help-gnu-emacs@gnu.org...
> lawrence mitchell <wence@gmx.li> writes:
>
> > > (bind-hook c-mode-hook
> >    ^^^^^^^^^^^^^^^^^^^^^
> > You probably meant:
> >
> >  (add-hook 'c-mode-hook
> >
> > > (font-lock-add-keywords nil
> > > '(("\\<\\(\\sw+\\) ?(" 1 font-lock-function-call-face))) t))
>
> Yes, sorry, I didn't test the code I posted, I just extracted the
> relevant looking parts from my init files and accidentally included my
> bind-hook macro. Here is a tested version
>
> ;; turn on font lock with maximum decoration
> (global-font-lock-mode t)
> (setq font-lock-maximum-decoration t)
>
> (require 'font-lock)
>
> ;; create a face for function calls
> (defface font-lock-function-call-face
>   '((t (:foreground "DarkBlue")))
>   "Font Lock mode face used to highlight function calls."
>   :group 'font-lock-highlighting-faces)
> (defvar font-lock-function-call-face 'font-lock-function-call-face)
>
> ;; add it to the font lock tables
> (add-hook 'c-mode-hook
>   (lambda ()
>     (font-lock-add-keywords
>      nil
>      '(("\\<\\(\\sw+\\) ?(" 1 font-lock-function-call-face)) t)))
>
> --
> jan
>
>
>
>




reply via email to

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