logo       

Re: C formatting: msg#00873

emacs.help

Subject: Re: C formatting

Oodini wrote:
hello,

I am fighting with EMacs in order to get my programmation style:

Did that a while back too, but thankfully someone gave me some code that gives a nice looking indentation style.

void function(int x, int y)
{
blabla;
if (...)
{
blabla
blabla
}
else
blabla;
}

This works ok for me and produces indentation like above

(add-hook 'c-mode-hook (function (lambda () (c-set-style "bsd") (setq c-basic-offset 4))))

and this works for Java mode (just in case you need it later)

(add-hook 'java-mode-hook (function (lambda () (c-set-style "bsd") (setq c-basic-offset 4))))


Danx
--
for personal replies change spamoff to chris


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise