1 ;;; This function switches C-mode so that it indents stuff according to
2 ;;; our style(9) which is equivalent to FreeBSD's. Tested with emacs-22.3.
4 ;;; Use "M-x bsd" in a C mode buffer to activate it.
6 ;;; To make this the default, use a line like this, but you can't easily
7 ;;; switch back to default GNU style, since the old state isn't saved.
9 ;;; (add-hook 'c-mode-common-hook 'bsd)
11 ;;; As long as you don't have this in the c-mode hook you can edit GNU
12 ;;; and BSD style C sources within one emacs session with no problem.
14 ;;; Posted to FreeBSD's cvs-all by DES (<867ifoaulz.fsf@ds4.des.no>).
20 ;; Basic indent is 8 spaces
21 (setq c-basic-offset
8)
24 ;; Continuation lines are indented 4 spaces
25 (c-set-offset 'arglist-cont
4)
26 (c-set-offset 'arglist-cont-nonempty
4)
27 (c-set-offset 'statement-cont
4)
28 (c-set-offset 'cpp-macro-cont
8)
30 ;; Labels are flush to the left
31 (c-set-offset 'label
[0])
34 (setq fill-column 74))