6.3.1 Built-in Styles

If you’re lucky, one of CC Mode’s built-in styles might be just what you’re looking for. These are:

gnu

Coding style blessed by the Free Software Foundation for C code in GNU programs.

k&r

The classic Kernighan and Ritchie style for C code.

bsd

Also known as “Allman style” after Eric Allman.

whitesmith

Popularized by the examples that came with Whitesmiths C, an early commercial C compiler.

stroustrup

The classic Stroustrup style for C++ code.

ellemtel

Popular C++ coding standards as defined by “Programming in C++, Rules and Recommendations,” Erik Nyquist and Mats Henricson, Ellemtel19.

linux

C coding standard for Linux (the kernel).

python

C coding standard for Python extension modules20.

java

The style for editing Java code. Note that the default value for c-default-style installs this style when you enter java-mode.

awk

The style for editing AWK code. Note that the default value for c-default-style installs this style when you enter awk-mode.

user

This is a special style created by you. It consists of the factory defaults for all the style variables as modified by the customizations you do either with the Customization interface or by writing setqs and c-set-offsets at the top level of your .emacs file (see Configuration Basics). The style system creates this style as part of its initialization and doesn’t modify it afterwards.


Footnotes

(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/.