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: Tom Oswald
Subject: Re: How do I get emacs to highlight subroutine calls in c-mode.
Date: Thu, 16 Oct 2003 12:36:52 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3.1) Gecko/20030428

jan wrote:
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)))


How would I add italic to the display? At present it displays the function names in "DarkBlue". What would be required to display function names in "DarkBlue" plus italics?

Tom



reply via email to

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