[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs cc-mode settings for KNF
> here is the relevant part of my ~/.emacs .. works for me, and does the
> style *I* like for the sources I maintain (maybe not the way the source of
> obsd is supposed to be formatted though, I haven't checked at all)
>
Here's a way that doesn't involve defining your own c-mode:
(defun my-c-style ()
(c-set-style "k&r")
(setq c-basic-offset 8))
(add-hook 'c-mode-common-hook 'my-c-style)
The beauty of adding to the c-mode-common-hook is you'll get the same
behavior in all c-modes (like c++-mode and objc-mode).
Pat