www.delorie.com/gnu/docs/emacs/cc-mode_fot.html   search  
 
Buy the book!


CC Mode Manual

[Top] [Contents] [Index] [ ? ]

Footnotes

(1)

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

(2)

A C-like scripting language with its roots in the LPC language used in some MUD engines. See http://pike.idonex.se/.

(3)

Unless otherwise noted, the term "C code" to refers to all the C-like languages.

(4)

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

(5)

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.

(6)

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.

(7)

The `C' would be replaced with `C++', `ObjC', `Java', `IDL', or `Pike' for the respective languages.

(8)

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.

(9)

Note that the aggregate constructs in Pike mode, `({', `})', `([', `])', and `(<', `>)', do not count as brace lists in this regard, even though they do for normal indentation purposes. It's currently not possible to set automatic newlines on these constructs.

(10)

The braces of anonymous classes produces a combination of inexpr-class, and class-open or class-close in normal indentation analysis.

(11)

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.

(12)

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.

(13)

i.e. it literally calls c-electric-backspace.

(14)

E.g. to c-electric-delete in your `.emacs' file. Note however, that Emacs 20 does not have a standard variable such as delete-key-deletes-forward.

(15)

comment-start, comment-end, comment-start-skip, paragraph-start, paragraph-separate, paragraph-ignore-fill-prefix, adaptive-fill-mode, adaptive-fill-regexp, and adaptive-fill-first-line-regexp.

(16)

It's available from http://www.wonderworks.com/. As of version 2.12, it does however lack a feature that makes it work suboptimally when c-comment-prefix-regexp matches the empty string (which it does by default). A patch for that is available from the CC Mode site.

(17)

In versions before 5.26, this variable was called c-comment-continuation-stars. As a compatibility measure, CC Mode still uses the value on that variable if it's set.

(18)

This means that the variables c-hanging-comment-starter-p and c-hanging-comment-ender-p, which controlled this behavior in earlier versions of CC Mode, are now obsolete.

(19)

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. Re-indenting such code will be slow.

(20)

Available in Emacs 20 and later, and XEmacs 19.15 and later.

(21)

Obviously, you use the key binding interactively, and the function call programmatically!

(22)

There is however a variable c-strict-syntax-p that, when set to non-nil, will cause an error to be signalled in that case. It's now considered obsolete since it doesn't work well with some of the alignment functions that now returns nil instead of zero to be more usable in lists. You should therefore leave c-strict-syntax-p set to nil.

(23)

You can try this interactively in a C buffer by typing the text that appears in italics.

(24)

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

(25)

This is a big change from versions of CC Mode earlier than 5.26, where such settings would get overridden by the style system unless special precautions were taken. That was changed since it was counterintuitive and confusing, especially to novice users. If your configuration depends on the old overriding behavior, you can set the variable c-old-style-variable-behavior to non-nil.

(26)

This did not change in version 5.26.

(27)

This document is available at http://www.doc.ic.ac.uk/lab/cplus/c++.rules/ among other places.

(28)

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

(29)

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

(30)

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.

(31)

The list of conditional keywords are (in C, C++, Objective-C, Java, and Pike): 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.

(32)

You might wonder why it doesn't get inlambda too. It's because the closing brace is relative to the opening brace, which stands on its own line in this example. If the opening brace was hanging on the previous line, then the closing brace would get the inlambda syntax too to be indented correctly.

(33)

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

(34)

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

(35)

such as the output of lex(1)!

(36)

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

(37)

This has been observed in Emacs 19.34 and XEmacs 19.15.

(38)

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

(39)

Technically, it's because some macros wasn't defined during the compilation, so the byte compiler put in function calls instead of the macro expansions. Later, when the interpreter tries to call the macros as functions, it shows this (somewhat cryptic) error message.

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003