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

Footnotes

(1)

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

(2)

There is no “easy customization” facility for making this change.

(3)

this is only useful for a line starting with a comment opener or an opening brace, parenthesis, or string quote.

(4)

The name of this command varies between (X)Emacs versions.

(5)

this was CC Mode’s behavior prior to version 5.32.

(6)

You can change this default by setting the string syntactic symbol (see section Syntactic Symbols and see section Customizing Indentation)

(7)

In GCC, unescaped line breaks within strings are valid.

(8)

You can emphasize non-default style comments in your code by giving their delimiters font-lock-warning-face. See section Marking “Wrong” style comments.

(9)

The ‘C’ would be replaced with the name of the language in question for the other languages CC Mode supports.

(10)

Prior to CC Mode 5.31, this command was bound to C-c C-d.

(11)

Prior to CC Mode 5.31, this command was bound to C-c C-t.

(12)

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

(13)

Prior to CC Mode 5.31, this command was bound to C-c C-d. C-c C-d is now the default binding for c-hungry-delete-forward.

(14)

This command was formerly known as c-hungry-backspace.

(15)

DON’T PANIC!!! This isn’t difficult.

(16)

In earlier versions of CC Mode, a File Style setting took precedence over any other setting apart from a File Local Variable setting.

(17)

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.

(18)

This did not change in version 5.26.

(19)

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

(20)

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

(21)

This table is stored internally in the variable c-fallback-style.

(22)

Note that if the variable has been given a value by the Customization interface or a setq at the top level of your ‘.emacs’, this value will override the one the style system tries to give it. See section Configuration Basics.

(23)

Also, if either of these are set in a file’s local variable section, all the style variable values are made local to that buffer, even if c-style-variables-are-local-p is nil. Since this variable is virtually always non-nil anyhow, you’re unlikely to notice this effect.

(24)

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.

(25)

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 web site.

(26)

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.

(27)

Actually, this default setting of c-block-comment-prefix typically gets overridden by the default style gnu, which sets it to blank. You can see the line splitting effect described here by setting a different style, e.g. k&r See section Choosing a Style.

(28)

Also insert a ‘\’ at the end of the previous line if you’re in AWK Mode.

(29)

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

(30)

Brace lists inside statements, such as initializers for static array variables inside functions in C, are recognized as statement-cont. All normal substatement blocks are recognized with other symbols.

(31)

This was first introduced in CC Mode 5.31.

(32)

Certain C++ constructs introduce ambiguous situations, so scope-operator clean-ups might not always be correct. This usually only occurs when scoped identifiers appear in switch label tags.

(33)

In CC Mode 5.28 and earlier, a syntactic element was a dotted pair; the cons was the syntactic symbol and the cdr was the anchor position. For compatibility’s sake, the parameter passed to a line-up function still has this dotted pair form (see section Custom Line-Up Functions).

(34)

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

(35)

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.

(36)

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.

(37)

These are briefly specified in comments in (defvar c-offsets-alist ...) in the source file ‘cc-vars.el’

(38)

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.

(39)

block-open is used only for “free-standing” blocks, and is somewhat rare (see section Comment String Label and Macro Symbols for an example.)

(40)

This extra syntactic element was introduced in CC Mode 5.33.1 to allow extra flexibility in indenting the second line of such a construct. You can preserve the behaviour resulting from the former syntactic analysis by giving brace-list-entry an offset of c-lineup-under-anchor (see section Miscellaneous Line-Up Functions).

(41)

Indeed an enum used to be parsed with these other symbols. The two types of construct were separated in 2024-09 to make it easier to give an enum indentation like that of a class.

(42)

These should logically be named extern-open, extern-close and inextern, but that isn’t the case for historical reasons.

(43)

This is how CC Mode 5.28 and earlier analyzed macros.

(44)

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.

(45)

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

(46)

The syntactic context ((defun-block-intro 2724) (comment-intro)) would likely have two relative offsets.

(47)

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

(48)

In this and subsequent examples, the original code is formatted using the ‘gnu’ style unless otherwise indicated. See section Styles.

(49)

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

(50)

This function is mainly provided to mimic the behavior of CC Mode 5.28 and earlier where this case wasn’t handled consistently so that those lines could be analyzed as either topmost-intro-cont or statement-cont. It’s used for topmost-intro-cont by default, but you might consider using + instead.

(51)

Returning nil is useful when the offset specification for a syntactic element is a list containing the line-up function (see section c-offsets-alist).

(52)

The numerical value returned by point will change if you change the indentation of the line within a save-excursion form, but point itself will still be over the same piece of text.

(53)

If this restriction causes your project difficulties, please get in touch with bug-cc-mode@gnu.org.

(54)

Note that the removal of directives doesn’t work satisfactorally on XEmacs or on very old versions of Emacs

(55)

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

(56)

This has been observed in Emacs 19.34 and XEmacs 19.15.

(57)

Using the variable open-paren-in-column-0-is-defun-start.


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

This document was generated on September 26, 2026 using texi2html 1.82.