help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programming Syntax Mode


From: Kai Großjohann
Subject: Re: Programming Syntax Mode
Date: Wed, 25 Sep 2002 18:05:14 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

briwilson2002@hotmail.com (Brian Wilson) writes:

> I am using emacs at college to program in C and C++ and note that
> there is syntax highlighting to allow me to see reserved words, etc.
> Is there a way I can start emacs from the shell with some kind of
> arguments so that I can not only have highlighting on by default,

M-x customize-group RET font-lock RET

Toggle the Global Font Lock option and don't forget to save your
changes.

> but so that I can decide which language to do it in? Something like
> 'emacs --lang=cpp --highlighting --color' ?

Emacs usually guesses the mode from the filename.  For example, foo.c
is a C file and foo.cpp is a C++ file.

If this is wrong for a specific file (*.h is used for C and C++
files), you can put "-*- c++ -*-" into the first line of the
file (sans quotes).  It could be in a comment, like so:

/* -*- c++ -*- */

I guess it's obvious how to change it for C files.

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)


reply via email to

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