all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Programming Syntax Mode
@ 2002-09-25 14:37 Brian Wilson
  2002-09-25 16:05 ` Kai Großjohann
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Wilson @ 2002-09-25 14:37 UTC (permalink / raw)


Dear All,

Apologies for cross-posting firstly....

Do forgive me if this is a simple question, but I have just started
using emacs and Linux, two things I am completely new to!

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, but
so that I can decide which language to do it in? Something like 'emacs
--lang=cpp --highlighting --color' ?

Any help would be most appreciated.


Brian Wilson

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

* Re: Programming Syntax Mode
  2002-09-25 14:37 Programming Syntax Mode Brian Wilson
@ 2002-09-25 16:05 ` Kai Großjohann
  0 siblings, 0 replies; 2+ messages in thread
From: Kai Großjohann @ 2002-09-25 16:05 UTC (permalink / raw)


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)

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

end of thread, other threads:[~2002-09-25 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-25 14:37 Programming Syntax Mode Brian Wilson
2002-09-25 16:05 ` Kai Großjohann

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.