next up previous contents index
Next: default mode Up: mode.sc Previous: mode.sc

C-C++ mode

In C-mode and C++mode the key bindings  defined by are:

Indentation  is parameterized by the following global variables:

The indentation rules for an empty line, for instance when you type a return at the end of a line, are (take a deep breath):

The indentation rules, when you indent a non empty line (for instance when you reindent a line with a tab) depend on the first character(s) (jumping space, tab, newline and comments) (cheer up !, we're almost there):

As you can see, it is rather complicated, nevertheless some cases are not taken into account and need braces. For instance it is the case for nested if like:


tabular1200

are poorly indented:


tabular1205

but the indentation is correct with braces:


tabular1210

Of course the quantity of code interpreted by when you type a simple return is rather disturbing, but don't be afraid, is a good boy.


next up previous contents index
Next: default mode Up: mode.sc Previous: mode.sc

Lionel Fournigault
Wed Apr 30 10:44:37 MET DST 1997