[Insight-developers] Anyone got Emacs config for ITK-standard indentation?

Jisung Kim bahrahm@yahoo.com
Wed, 30 Apr 2003 13:01:12 -0700 (PDT)


I'm using Emacs 21.2.1.

I slightly modified the stroustrup style that is a
part of the .cpp.el file in the emacs distribution
file.

You can add the following codes into your .emacs file.


;;;;;;;;;;;;;;

(c-add-style "itk"
             '("stroustrup" 
               (c-basic-offset . 2)
               (c-offsets-alist
                 (innamespace . 0)
                 (inline-open . 0) 
                 (substatement-open . +)
                 (statement-block-intro . 0) ) ) )

(add-hook 'c++-mode-hook (function (lambda ()
 (c-set-style "itk")(turn-on-auto-fill))))


(add-to-list 'auto-mode-alist '("\\.txx\\'" .
c++-mode))
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))

;;;;;;;;;;;

I believe this make any c++ files confirm ITK
indentation style.


--- Kent Williams <kent@mail.psychiatry.uiowa.edu>
wrote:
> So my latest checkins were criticized for
> indentation style; sorry!  My 
> problem is that I either have to turn off
> auto-indent in Emacs, or trick it 
> into enforcing the ITK coding standards -- in
> particular, Emacs wants to do 
> this:
> 
> 	if ( this )
> 		{
> 			Do That;
> 		}
> 
> And ITK wants:
> 
> 	if ( this )
> 		{
> 		Do That;
> 		}
> 
> I also gather from Bill's reformatting that there's
> no indent inside a 
> namespace. Emacs doesn't want to do that either.
> 
> I know that C++-mode in Emacs is configurable, and
> I'm willing to slog into it 
> and figure it out, but if someone else has already
> done this, please share! 
> Thanks!
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
>
http://public.kitware.com/mailman/listinfo/insight-developers


=====
Jisung Kim
bahrahm@yahoo.com
106 Mason Farm Rd.
129 Radiology Research Lab., CB# 7515
Univ. of North Carolina at Chapel Hill
Chapel Hill, NC 27599-7515

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com