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: 11 Oct 2003 18:43:58 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

> I would like subroutine calls hightlighted.  For example, in
> "callThisSub(param1)" enacs would highlight "callThisSub".

(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 
(bind-hook c-mode-hook
        (font-lock-add-keywords nil
                '(("\\<\\(\\sw+\\) ?(" 1 font-lock-function-call-face))) t))

try placing this in your .emacs file.

-- 
jan






reply via email to

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