"The Annotated C++ Reference Manual", by Ellis and Stroustrup.
or C++, Objective-C, Java or IDL code. In general, for the rest of this manual I'll use the term "C code" to refer to all the C-like dialects, unless otherwise noted.
The line numbers in this and future examples don't actually appear in the buffer, of course!
With a universal argument (i.e. C-u C-c C-s) the analysis is inserted into the buffer as a comment on the current line.
A substatement is the line after a
conditional statement, such as if
, else
, while
,
do
, switch
, etc. A substatement
block is a brace block following one of these conditional statements.
Remember that the `C' could be replaced with `C++', `ObjC', `Java' or `IDL'.
A literal is defined as any comment, string, or C preprocessor macro definition. These constructs are also known as syntactic whitespace since they are usually ignored when scanning C code.
Certain C++
constructs introduce ambiguous situations, so scope-operator
clean-ups may not always be correct. This usually only occurs when
scoped identifiers appear in switch label tags.
I say "hit the Backspace key" but
what I really mean is "when Emacs receives the BackSpace
key
event". The difference usually isn't significant to most users, but
advanced users will realize that under window systems such as X, any
physical key (keycap) on the keyboard can be configured to generate any
keysym, and thus any Emacs key event. Also, the use of Emacs on TTYs
will affect which keycap generates which key event. From a pedantic
point of view, here we are only concerned with the key event that
Emacs receives.
To get block
comment continuation lines indented under the block comment starter
(e.g. the `/*'), it is not enough to set
c-comment-continuation-stars
to the empty string. You need to do
this, but you also need to set the offset for the c
syntactic
symbol to be zero.
In particular, I have had people
complain about the speed with which lex(1)
output is re-indented.
Lex, yacc, and other code generators usually output some pretty
perversely formatted code. Don't try to indent this stuff!
Actually what happens is that the
function stored in c-insert-tab-function
is called.
Normally this just inserts a real tab character, or the equivalent
number of spaces, depending on the setting of the variable
indent-tabs-mode
. If you preferred, you could set
c-insert-tab-function
to tab-to-tab-stop
for example.
The caveat about indent-tabs-mode
in the
previous footnote also applies here.
You should not use specialized filling packages such as
filladapt
with CC Mode. They don't work as well for filling as
c-fill-paragraph
It will not be placed on a separate line if it is not already on a separate line.
This variable is t
by default, except in java-mode
. Hanging comment starters mess
up Javadoc style comments.
The same caveat as above holds true.
In this an subsequent examples, the original code is formatted using the `gnu' style unless otherwise indicated. See section Styles.
The interaction between java-mode
and the hook
variables is slightly different than for the other modes.
java-mode
sets the style (see section Styles) of the buffer to
`java' before running the c-mode-common-hook
or
java-mode-hook
. You need to be aware of this so that style
settings in c-mode-common-hook
don't clobber your Java style.
This document is ftp'able from
euagate.eua.ericsson.se
Python is a high level scripting language with a C/C++
foreign function interface. For more information, see
<http://www.python.org/>
.
It probably makes more
sense to add this to c++-mode-hook
than c-mode-common-hook
since stream operators are only relevent for C++.
Run-in style doesn't really work too well. You might need to write your own custom indentation functions to better support this style.
This is the case even
for C and Objective-C. For consistency, structs in all supported
languages are syntactically equivalent to classes. Note however that
the keyword class
is meaningless in C and Objective-C.
The list of conditional keywords are (in
C, C++, Objective-C, and Java): for
, if
, do
,
else
, while
, and switch
. C++ and Java have two
additional conditional keywords: try
and catch
. Java also
has the finally
and synchronized
keywords.
a.k.a. K&R C, or Kernighan & Ritchie C
such as the output of lex(1)
!
e.g. a function in C, or outermost class definition in C++ or Java.
Note that this variable is only defined in Emacs 19.
This has been observed in Emacs 19.34 and XEmacs 19.15.
It is hard to distinguish them from top-level declarations.
This document was generated on 6 November 2000 using texi2html 1.56k.