unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Syntax highlighting question
@ 2004-02-16 15:30 William Payne
  2004-02-16 16:12 ` Peter Lee
  0 siblings, 1 reply; 5+ messages in thread
From: William Payne @ 2004-02-16 15:30 UTC (permalink / raw)


Hello, I'm using Emacs to code in C and C++. I have syntax highlighting and
automatic indentation set up to a decent level (not perfect yet), but I have
a really annoying problem.
Example:
when I type the following:
pthread_t mythread;
emacs displays "pthread_t" in white, bold text and "mythread" in normal,
yellow text. Just as I want it. But now when I have to use the Win32 for a
project, emacs doesn't recognise the window datatypes as datatypes. So
HWND mywindow; is displayed by Emacs in white, normal text. How can I make
Emacs recognise the windows data types as data types, so they get
highlighted properly?

/ WP

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Syntax highlighting question
  2004-02-16 15:30 Syntax highlighting question William Payne
@ 2004-02-16 16:12 ` Peter Lee
  2004-02-16 17:35   ` William Payne
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Lee @ 2004-02-16 16:12 UTC (permalink / raw)


>>>> William Payne writes:

    William> How can I make Emacs recognise the windows data types as
    William> data types, so they get highlighted properly?

Look for a package called ctypes.  Should be able to find ctypes.el
via google.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Syntax highlighting question
  2004-02-16 16:12 ` Peter Lee
@ 2004-02-16 17:35   ` William Payne
  0 siblings, 0 replies; 5+ messages in thread
From: William Payne @ 2004-02-16 17:35 UTC (permalink / raw)



"Peter Lee" <pete_lee@swbell.net> wrote in message
news:uy8r3dmut.fsf@swbell.net...
> >>>> William Payne writes:
>
>     William> How can I make Emacs recognise the windows data types as
>     William> data types, so they get highlighted properly?
>
> Look for a package called ctypes.  Should be able to find ctypes.el
> via google.
>
>

Thanks, I heard about cc modes, and upgraded to the latest version and that
solved my problem.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* syntax highlighting question
@ 2004-05-01 18:47 Aliesha Finkel
  0 siblings, 0 replies; 5+ messages in thread
From: Aliesha Finkel @ 2004-05-01 18:47 UTC (permalink / raw)


Hi, I'd like to make a new region to syntax highlight
similar to C-style comments.  I'd like to start it
with
// DBG
and end it with
// GBD

Everything in-between I'd like to set to some color. 
I'm a newbie to emacs customization, does anyone know
off-hand if this can be done in emacs, or are things
like C-style comments hardcoded somewhere?

Thanks in advance.


	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: syntax highlighting question
       [not found] <mailman.2848.1083437514.1061.help-gnu-emacs@gnu.org>
@ 2004-05-04  3:26 ` Jesper Harder
  0 siblings, 0 replies; 5+ messages in thread
From: Jesper Harder @ 2004-05-04  3:26 UTC (permalink / raw)


Aliesha Finkel <agfinkel@yahoo.com> writes:

> I'd like to make a new region to syntax highlight similar to C-style
> comments.  I'd like to start it with
> // DBG
> and end it with
> // GBD
>
> Everything in-between I'd like to set to some color.  I'm a newbie
> to emacs customization, does anyone know off-hand if this can be
> done in emacs

Yes, it can be done.  You need to use the variable
`font-lock-syntactic-keywords' -- see the node "Syntactic Font Lock"
in the Emacs Lisp Manual for details.

-- 
Jesper Harder                                <http://purl.org/harder/>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-05-04  3:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-16 15:30 Syntax highlighting question William Payne
2004-02-16 16:12 ` Peter Lee
2004-02-16 17:35   ` William Payne
  -- strict thread matches above, loose matches on Subject: below --
2004-05-01 18:47 syntax " Aliesha Finkel
     [not found] <mailman.2848.1083437514.1061.help-gnu-emacs@gnu.org>
2004-05-04  3:26 ` Jesper Harder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).