logo_kerberos.gif

Difference between revisions of "Coding style/Transition strategies"

From K5Wiki
Jump to: navigation, search
(New page: == 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: <pre> /* -*- mode: c; inde...)
 
Line 6: Line 6:
 
/* -*- mode: c; indent-tabs-mode: nil -*- */
 
/* -*- mode: c; indent-tabs-mode: nil -*- */
 
</pre>
 
</pre>
  +
  +
== Indentation ==
  +
  +
To mark files as having indentation conforming to our coding style, add <code>c-file-style: "krb5"</code> to the local variable line:
  +
  +
<pre>
  +
/* -*- mode: c; c-file-style: "krb5"; indent-tabs-mode: nil -*- */
  +
</pre>
  +
  +
Remember to add the definition of the "krb5" c style to your <code>.emacs</code> file.
  +
  +
For BSD-derived code, use
  +
  +
<pre>
  +
/* -*- mode: c; c-file-style: "bsd"; indent-tabs-mode: t -*- */
  +
</pre>
  +
  +
If we get a style declaration for the "sun" C style, use that where appropriate as well (<code>src/lib/rpc</code> among others).
  +
  +
== Vim? ==
  +
  +
Do we want to add file modelines for vim?

Revision as of 08:08, 22 June 2009

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?