[comp.emacs] indentation in c-mode

hsu%ic.Berkeley.EDU@BERKELEY.EDU.UUCP (03/30/87)

	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