From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Javier Oviedo" Newsgroups: gmane.emacs.help Subject: Re: How do I get emacs to highlight subroutine calls in c-mode. Date: Mon, 13 Oct 2003 09:44:52 -0400 Organization: Texas Instruments Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1066053822 658 80.91.224.253 (13 Oct 2003 14:03:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Oct 2003 14:03:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 13 16:03:40 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 1A93IS-00048R-00 for ; Mon, 13 Oct 2003 16:03:40 +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 1A93Fx-0005gJ-Mt for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Oct 2003 10:01:05 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!attdl1!attdl2!ip.att.net!news.ti.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-NNTP-Posting-Host: gt64v7121.telogy.design.ti.com Original-X-Trace: home.itg.ti.com 1066052692 13957 158.218.105.183 (13 Oct 2003 13:44:52 GMT) Original-X-Complaints-To: usenet@news.ti.com Original-NNTP-Posting-Date: 13 Oct 2003 13:44:52 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Original-Xref: shelby.stanford.edu gnu.emacs.help:117227 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:13156 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13156 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" wrote in message news:mailman.1544.1065932192.21628.help-gnu-emacs@gnu.org... > 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))) > > -- > jan > > > >