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

Miller, James V (Research) millerjv@crd.ge.com
Thu, 1 May 2003 10:31:00 -0400


Ooooh.  I like this better than mine.  Anything that simplies
my emacs configurations is a good thing.

I did remove the inline-open setting.  I have been meaning to do
that for years!



> -----Original Message-----
> From: Jisung Kim [mailto:bahrahm@yahoo.com]
> Sent: Wednesday, April 30, 2003 4:01 PM
> To: norman-k-williams@uiowa.edu; Insight Developers List
> Subject: Re: [Insight-developers] Anyone got Emacs config for
> ITK-standard indentation?
> 
> 
> 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
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>