logo       

Re: C formatting: msg#00887

emacs.help

Subject: Re: C formatting

chris.danx a écrit:
Oodini wrote:

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))))

Well, it doesn't do exactly what I want.
After the "if", when I press Enter, Emacs put an extra indent, whereas I want it to put the cursor under the "if". I guess it supposes I put the opening brace af the end of the line where there is the "if".

--
. .
. .:::. ### \|/ ` ___ '
:(o o): . (o o) (o o) - (O o) -
ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-


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

News | FAQ | advertise