# CC-MODE Version 4 Documentation

### (1)

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

### (2)

or C++, Objective-C, or Java 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)

A substatement indicates the line after an `if`, `else`, `while`, `do`, `switch`, or `for` statement, and a substatement block is a brace block following one of those constructs.

### (5)

Remember that the ``C'` would be replaced with ``C++'` or ``ObjC'` if you were editing C++ or Objective-C code.

### (6)

A literal is defined in `cc-mode` as any comment, string, or cpp macro definition. These constructs are also known as syntactic whitespace since they are usually ignored when scanning C code.

### (7)

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.

### (8)

In particular, I have had people complain about the speed that `cc-mode` re-indents `lex(1)` output. Lex, yacc, and other code generators usually output some pretty perverse code. Don't try to indent this stuff with `cc-mode`!

### (9)

The reason you need to use `setq-default` instead of `setq` is that `c-basic-offset` is a buffer local variable, as are most of the `cc-mode` configuration variables. If you were to put this code in, e.g. your `c-mode-common-hook` function, you could use `setq`.

### (10)

The use of `add-hook` in this example only works for Emacs 19. Workarounds are available if you are using Emacs 18.

### (11)

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

### (12)

It probably makes more sense to add this to `c++-mode-hook` than `c-mode-common-hook` since stream operators are only relevant for C++.

### (13)

This is the case even for C and Objective-C. For consistency, structs in all three languages are syntactically equivalent to classes. Note however that the keyword `class` is meaningless in C and Objective-C.

### (14)

The list of conditional keywords are (in C, Objective-C and C++): `for`, `if`, `do`, `else`, `while`, and `switch`. C++ has two additional conditional keywords: `try` and `catch`.

### (15)

The need for this somewhat confusing arrangement is that the typical indentation desired for these lines is calculated very differently. This should be simplified in version 5 of `cc-mode`, along with the added distinction between argument lists in function declarations, and argument lists in function calls.

### (16)

The `comment-intro` syntactic symbol is known generically as a modifier since it always appears on a syntactic analysis list with other symbols, and never has a relative buffer position.

### (17)

In C++ only.

### (18)

Note that this variable is only defined in Emacs 19.

This document was generated on 29 April 1997 using the texi2html translator version 1.51. Hacked to generate 8.3 filenames by Luis Hernández.