🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #189405

Indentation of declarations in C-mode

#189405
From: Hugh Fader
Date: Mon, 04 Mar 1991 17:15
39 lines
1377 bytes
I want to make declarations appear as follows:

fn()
{
    int    i,     /* description of i */
           j;     /* description of j */
    char  *c,     /* description of c */
           str[]; /* description of str */
    
	
}

C-mode, by default, wants to align the variables with their types
like this:

fn()
{
    int i,
    j;
    char *c,
    str;
    
}

In the past, I have used vi and indent to get the desired result. Surely
emacs can do what vi and indent can. Can anybody show me how?
    
Also, indent can place open braces as follows:

    if (i = 1) {
    
C-mode with c-auto-newline enabled wants to put the opening
brace on the next line. Can I fix this?

	Thanks in advance
--
Hugh Fader
hugh@slee01.srl.ford.com
Technical Details
Message-ID: <37060@fmsrl7.UUCP>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!wuarchive!zaphod.mps.ohio-state.edu!rphroy!teemc!fmsrl7!slee01!hugh

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,7510b59345102ce5,start
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-03-06 13:45:53 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!wuarchive!zaphod.mps.ohio-state.edu!rphroy!teemc!fmsrl7!slee01!hugh
From: hugh@slee01.srl.ford.com (Hugh Fader)
Newsgroups: gnu.emacs.help
Subject: Indentation of declarations in C-mode
Message-ID: <37060@fmsrl7.UUCP>
Date: 4 Mar 91 17:15:08 GMT
Sender: root@fmsrl7.UUCP
Reply-To: hugh@slee01.srl.ford.com (Hugh Fader)
Organization: Ford Motor Co, Sci. Res. Labs., Dearborn, MI
Lines: 39