[oclug] Braces in Emacs

Jim Tittsler jtittsler at netwinder.org
Mon Jan 22 00:56:10 EST 2001


On Sun, Jan 14, 2001 at 03:06:14PM -0500, Trevor Curtis wrote:
> I find this awkward and difficult to read.  I would prefer this:
> 
> 	if (blah == 6)
> 	{
> 	  do_something();
> 	}

The position of the opening brace is controlled by the value of
substatement-open in the c-offsets-alist.  You can set it in
your current buffer by doing:
  C-c C-o substatement-open RET 0 RET
You should be able to set it in your .emacs to make it always happen:
  (setq c-default-style '((other . "user")))
  (c-set-offset 'substatement-open 0)

For more than you ever want to know about tweaking C mode:
 $ info emacs Programs "Program Indent" "Custom C Indent"
 



More information about the OCLUG mailing list