CC MODE Version 5 Documentation


(1)

"The Annotated C++ Reference Manual", by Ellis and Stroustrup.

(2)

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.

(3)

The line numbers in this and future examples don't actually appear in the buffer, of course!

(4)

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.

(5)

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.

(6)

Remember that the `C' could be replaced with `C++', `ObjC', `Java' or `IDL'.

(7)

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.

(8)

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.

(9)

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.

(10)

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.

(11)

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!

(12)

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.

(13)

The caveat about indent-tabs-mode in the previous footnote also applies here.

(14)

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

(15)

It will not be placed on a separate line if it is not already on a separate line.

(16)

This variable is t by default, except in java-mode. Hanging comment starters mess up Javadoc style comments.

(17)

The same caveat as above holds true.

(18)

In this an subsequent examples, the original code is formatted using the `gnu' style unless otherwise indicated. See section Styles.

(19)

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.

(20)

This document is ftp'able from euagate.eua.ericsson.se

(21)

Python is a high level scripting language with a C/C++ foreign function interface. For more information, see <http://www.python.org/>.

(22)

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++.

(23)

Run-in style doesn't really work too well. You might need to write your own custom indentation functions to better support this style.

(24)

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.

(25)

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.

(26)

a.k.a. K&R C, or Kernighan & Ritchie C

(27)

such as the output of lex(1)!

(28)

e.g. a function in C, or outermost class definition in C++ or Java.

(29)

Note that this variable is only defined in Emacs 19.

(30)

This has been observed in Emacs 19.34 and XEmacs 19.15.

(31)

It is hard to distinguish them from top-level declarations.


This document was generated on 6 November 2000 using texi2html 1.56k.