tags:

views:

108

answers:

1

I want to set up the indentation for if-else statements to be 4 spaces. I have defined in my xemacs setup file

(add-hook 'c-mode-hook

 (function 
    (lambda()
       (setq c-if-indent 4) )))

And I also have (setq-default tab-width 4) (setq-default indent-tabs-mode nil)

After setting the above parameters, My tabs are being converted to spaces but the if else statement indentation is still coming out to be 8 characters after "{"

So, If I write

     if (test)
     {
             j++
     }

j++ starts at 8th column after "{", I want it to make 4 spaces instead of 8. Which hook do I need to set up for this?

A: 
(add-hook 'c-mode-hook   (lambda () (setq c-basic-offset 4)))
Henry