From: Peter Lee <pete.a.lee@gmail.com>
Subject: Re: Unusual C indentation conventions
Date: Tue, 29 Mar 2005 15:48:21 GMT [thread overview]
Message-ID: <uhdiufo83.fsf@gmail.com> (raw)
In-Reply-To: Ij02e.3964$zl.2748@newssvr13.news.prodigy.com
>>>> no spam writes:
> 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)
Try this.. you'll probably want to modify the tabs.
(setq indent-tabs-mode nil
tab-always-indent nil
tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60)
tab-width 4)
(defun my-c-mode-common-hook ()
(turn-on-font-lock)
(setq c-tab-always-indent nil)
(c-set-offset 'substatement-open 0)
(c-set-offset 'arglist-intro 1)
(c-set-offset 'defun-open 4)
(c-set-offset 'defun-block-intro 0)
(c-set-offset 'statement 0)
(c-set-offset 'substatement-open 4)
(c-set-offset 'statement-block-intro 0)
(c-set-offset 'substatement 4)
(c-set-offset 'statement-cont 4)
(c-set-offset 'label -4)
(c-set-offset 'topmost-intro-cont 4)
(c-set-offset 'brace-list-intro 0)
(c-set-offset 'class-open 4)
(c-set-offset 'class-close 4)
(c-set-offset 'topmost-intro '-)
(c-set-offset 'brace-list-open 4)
(c-set-offset 'access-label '--)
(c-set-offset 'func-decl-cont 0)
(c-set-offset 'case-label 0)
(c-set-offset 'statement-case-intro 4)
(c-set-offset 'statement-case-open 4)
(c-set-offset 'inline-open '+))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
next prev parent reply other threads:[~2005-03-29 15:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-28 23:21 Unusual C indentation conventions no spam
2005-03-29 12:57 ` Greg Rowe
2005-03-29 15:48 ` Peter Lee [this message]
2005-03-29 18:23 ` Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=uhdiufo83.fsf@gmail.com \
--to=pete.a.lee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.