C, C++ - C and C++ programming language templates
hkc.emf - C programming language hook definition
hkcpp.emf - C++ programming language hook definition
c.etf - C programming language template file
h.etf - C programming language header template file
cpp.etf - C++ programming language template file
hpp.etf - C++ programming language header template file
.c, .h, .def - ANSI C
.cpp, .cc, .hpp, .rc .C (UNIX only) - C++ programming language
.l - LEX
.y - YACC
.i - C (or C++) pre-processed file (i.e. output from pre-processor).
.rc - Microsoft Developer resource file.
-*- c -*-
-*- c++ -*-
The C and C++ file type templates offer the most sophisticated editing features within the MicroEmacs '99 environment.
General Editing
Hilighting
Auto Layout
restyle-region(3) and restyle-buffer(3) are available to reformat (re-layout) selected sections of the buffer, or the whole buffer, respectively.
Comments may be formatted using esc o, which reformats the comments according to the current fill paragraph. If a comment commences with /***... then the comment is automatically formatted to a box.
Tags
Folding and Information Hiding
The Tools -> C-Tools menu allows #define's to be evaluated within the buffer. Where the state of a #if is established to be false (using the #define information) then the disabled region of code is grayed out indicating which regions of the code are active.
Working Environment
rcs-file(2) is automatically invoked if an RCS file is detected, the normal check-in/out operations may be performed through the editor.
Short Cuts
C-c C-c - Comment out the current line.
C-c C-d - Uncomment the current line.
C-c C-e - Comment to the end of the line with stars (*).
A-C-i - Restyle the current region.
esc q - Format a comment.
esc o - Format a comment.
f2 - (un)fold the current region
f3 - (un)fold all regions
If the default language is C++, rather than 'C' the order of the file hooks should be over-ridden in the users local setup, using:-
add-file-hook ".c " fhook-c add-file-hook ".cc .cpp .hpp .rc .h .def .l .y .i" fhook-cpp
This defaults all .h and .def files etc. to be C++ rather than C.
The hilighting is typically extended using a file myc.emf (or mycpp.emf) i.e. to include the usual extended types of int32 etc, myc.emf might be defined as:-
hilight .hilight.c 1 "uint8" .scheme.type hilight .hilight.c 1 "int8" .scheme.type hilight .hilight.c 1 "uint16" .scheme.type hilight .hilight.c 1 "int16" .scheme.type hilight .hilight.c 1 "uint32" .scheme.type hilight .hilight.c 1 "int32" .scheme.type hilight .hilight.c 1 "float32" .scheme.type hilight .hilight.c 1 "float64" .scheme.type
The 'C' and 'C++' templates have been throughly used, there are no known issues with the templates.
The .rc hilighting is a little bogus and should not really be mapped onto .cpp. Do not attept to re-style.
c-brace(5), cmode(2m), compile(3), ctags(3f), find-tag(2), fold-all(3), fold-current(3), rcs-file(2), restyle-buffer(3), restyle-region(3), time(2m).
(c) Copyright JASSPA 1999
Last Modified: 1999/08/31
Generated On: 1999/12/01