logo_kerberos.gif

Coding style/Transition strategies

From K5Wiki
< Coding style
Revision as of 09:08, 22 June 2009 by TomYu (talk | contribs)

Jump to: navigation, search

Whitespace

To mark files as having all tabs expanded to space characters, place the following Emacs mode/local-variable line at the very top of the file:

/* -*- mode: c; indent-tabs-mode: nil -*- */

Indentation

To mark files as having indentation conforming to our coding style, add c-file-style: "krb5" to the local variable line:

/* -*- mode: c; c-file-style: "krb5"; indent-tabs-mode: nil -*- */

Remember to add the definition of the "krb5" c style to your .emacs file.

For BSD-derived code, use

/* -*- mode: c; c-file-style: "bsd"; indent-tabs-mode: t -*- */

If we get a style declaration for the "sun" C style, use that where appropriate as well (src/lib/rpc among others).

Vim?

Do we want to add file modelines for vim?