all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Javier Oviedo" <email_joviedo@yahoo.com>
Subject: Re: How do I get emacs to highlight subroutine calls in c-mode.
Date: Mon, 13 Oct 2003 09:44:52 -0400	[thread overview]
Message-ID: <bmea8k$dk5$1@home.itg.ti.com> (raw)
In-Reply-To: mailman.1544.1065932192.21628.help-gnu-emacs@gnu.org

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" <janmar@iprimus.com.au> wrote in message
news:mailman.1544.1065932192.21628.help-gnu-emacs@gnu.org...
> 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
>
>
>
>

  parent reply	other threads:[~2003-10-13 13:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-10 20:47 How do I get emacs to highlight subroutine calls in c-mode Tom Oswald
     [not found] ` <mailman.1526.1065861258.21628.help-gnu-emacs@gnu.org>
2003-10-11 12:21   ` lawrence mitchell
2003-10-12 21:26     ` jan
     [not found]     ` <mailman.1544.1065932192.21628.help-gnu-emacs@gnu.org>
2003-10-13 13:44       ` Javier Oviedo [this message]
2003-10-17 17:40         ` jan
2003-10-16 19:36       ` Tom Oswald
2003-10-12  1:43 ` jan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='bmea8k$dk5$1@home.itg.ti.com' \
    --to=email_joviedo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.