[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18. Editing C Code

This is a smart editing mode for C code. It knows a lot about C syntax and tries to position the cursor according to C layout conventions. You can change the details of the layout style with option variables.

The mode provides the following features:

The variables controlling indentation style are:

c-tab-always-indent
Non-nil means TAB in C mode should always reindent the current line, regardless of where in the line point is when the TAB command is used.

c-auto-newline
Non-nil means automatically newline before and after braces, and after colons and semicolons, inserted in C code.

c-indent-level
Indentation of C statements within surrounding block. The surrounding block's indentation is the indentation of the line on which the open-brace appears.

c-continued-statement-offset
Extra indentation given to a substatement, such as the then-clause of an if or body of a while.

c-continued-brace-offset
Extra indentation given to a brace that starts a substatement. This is in addition to c-continued-statement-offset.

c-brace-offset
Extra indentation for line if it starts with an open brace.

c-brace-imaginary-offset
An open brace following other text is treated as if it were this far to the right of the start of its line.

c-argdecl-indent
Indentation level of declarations of C function arguments.

c-label-offset
Extra indentation for line that is a label, or case or default.

NOTE: This package has been obsoleted by the cc-mode package (see section `Top' in CC Mode Manual). cc-mode can be quite slow, however, on large files, even on fast machines. This version works with no problems on the XEmacs source code and is very very fast.

To configure this package, type:

 
  M-x customize-group RET old-c RET


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs shared group account on December, 19 2009 using texi2html 1.65.