From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Tom Oswald Newsgroups: gmane.emacs.help Subject: Re: How do I get emacs to highlight subroutine calls in c-mode. Date: Thu, 16 Oct 2003 12:36:52 -0700 Organization: Posted via Supernews, http://www.supernews.com Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1066335060 5970 80.91.224.253 (16 Oct 2003 20:11:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2003 20:11:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 16 21:46:21 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AAE4j-0002Uv-00 for ; Thu, 16 Oct 2003 21:46:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AAE4P-0003iS-LB for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Oct 2003 15:46:01 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!sn-xit-02!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3.1) Gecko/20030428 X-Accept-Language: en-us, en In-Reply-To: Original-X-Complaints-To: abuse@supernews.com Original-Lines: 47 Original-Xref: shelby.stanford.edu gnu.emacs.help:117324 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13254 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13254 jan wrote: > lawrence mitchell 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