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: jan
Subject: Re: How do I get emacs to highlight subroutine calls in c-mode.
Date: 12 Oct 2003 14:26:13 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

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]