no spam wrote:
The code follows an indentation convention that is a bit
unusual for C.  Opening and closing braces are on
a line by themselves and are indented at the same
level as the block they enclose:
    if (someTest)
        {
        doSomething();
        doSomethingElse();
        }
Tab stops are set to 8.  Each block of code is
indented by 4 from the previous block.  (In the
vi editor set ts=8  set sw=4)


The coding style whitesmith is close. C-c . to run c-set-style. Choose whitesmith. You can change the indenting amount in cc-mode by doing M-x set-variable and set c-basic-offset to the number of spaces you desire.

You can change the tab stop width using the tab-width variable. M-x set-variable again.

In your .emacs you might want something like the following to make everything happen automatically:


(add-hook c-mode (lambda () (c-set-style "whitesmith") (setq c-basic-offset 4) (setq tab-width 8)))

Good luck!

Greg

--
Home is where the .bashrc is.
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to