There are a variety of code formatting modes built into emacs that will do
just what you are requesting. I have found that ellemtel best meets my
needs but you will have to play with them to find which one matches yours.
Code snippet from my .emacs to use ellemtel spacing below.
Ben
;; set indentation style to ellemtel
(defun my-c-mode-common-hook ()
;; use Ellemtel style for all C like languages
(c-set-style "ellemtel")
)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
Jeff Rancier wrote:
> Given:
>
> Jde Gen K&R: [Hide] [Toggle] off (nil)
> [State]: this option has been set and saved.
> If non-nil, use braces in Original Kerningham & Ritchie Style. [Hide]
> The Creators of C started using brace placement style:
>
> class Some {
>
> }
>
> But there is also alternative line-up style
>
> class Some
> {
>
> }
>
> Setting this variable to t, uses k&R style in skeletons and tempaltes.
>
> Changing this variable after JDE is loaded does nothing,
> because it is evaluated at load time to set up default templates.
>
> Can anyone tell me why my braces line up as follows:
>
> void method1( char *var21, int var2 )
> {
> return 2;
> }
>
> Also, I am assuming that the expansion of *main* doesn't refererence the
> Jde Gen K&R option. Can the braces style for main be customized?
>
> Thanks,
> Jeff
--
Ben Coughenour | Diplomacy is saying: "Nice doggie!"
[EMAIL PROTECTED] | ...till you can find a rock.
(919) 991-7733 |