Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!mit-eddie!BERKELEY.EDU!hsu%ic.Berkeley.EDU From: hsu%ic.Berkeley.EDU@BERKELEY.EDU.UUCP Newsgroups: comp.emacs Subject: indentation in c-mode Message-ID: <8703300649.AA01954@ic.Berkeley.EDU> Date: Mon, 30-Mar-87 01:49:16 EST Article-I.D.: ic.8703300649.AA01954 Posted: Mon Mar 30 01:49:16 1987 Date-Received: Tue, 31-Mar-87 04:42:48 EST Sender: daemon@mit-eddie.MIT.EDU Lines: 42 Gnumacs has several parameters that control the indentation style in c-mode. I have an indentation style where I indent 8 spaces (a tab) for statements immediately enclosed by the outermost block and 2 spaces thereafter. Closing braces are lined up with the beginning of the compound statement. For example, main() { int i; /* first indentation level is 8 spaces */ if (exists("God")) printf("Hallelujah\n"); /* 2 spaces thereafter */ switch (phase_of_moon()) { case FULL: beware(); break; case SLIVER: pie(); for (i=0; i<10; i++) { printf("%d\n", i); /* 2 spaces */ } break; } /* closing braces line up with the beginning of constructs */ if (boo) { hoo(); hoo(); } /* closing brace */ } There doesn't appear to be a way to do this with the built-in parameters. I tried to change the source, but not being a lisp hacker, I didn't get very far. If anyone can figure out how to do this, I would greatly appreciate it. This is the sole reason I don't use gnumacs to edit C programs. Thanks. Jeffrey hsu@ic.Berkeley.EDU