cvs commit: src/tools/tools/editing freebsd.vim

David O'Brien obrien at FreeBSD.org
Sun Mar 30 16:27:34 PDT 2008


On Thu, Mar 27, 2008 at 07:29:28PM +0100, Dag-Erling Smrgrav wrote:
> > I think this should be mentioned in the developer's handbook because,
> > IIRC, the sample .emacs file in there is bogus and doesn't really
> > respect style(9).

DES,
This is what should be committed?

Index: freebsd.el
===================================================================
RCS file: /home/ncvs/src/tools/tools/editing/freebsd.el,v
retrieving revision 1.1
diff -u -p -r1.1 freebsd.el
--- freebsd.el	15 Dec 1998 16:51:49 -0000	1.1
+++ freebsd.el	30 Mar 2008 23:26:42 -0000
@@ -22,7 +22,7 @@
 ;;; As long as you don't have this in the c-mode hook you can edit GNU
 ;;; and BSD style C sources within one emacs session with no problem.
 ;;;
-;;; Please report problems and additions directly to cracauer at freebsd.org
+;;; Please report problems and additions via 'send-pr'
 
 (defun bsd () (interactive)
   (c-set-style "bsd")
@@ -34,7 +34,22 @@
   (c-set-offset 'statement-case-intro 8)
   (c-set-offset 'substatement-open 4)
   (c-set-offset 'substatement 8)
-  (c-set-offset 'arglist-cont-nonempty 4)
   (c-set-offset 'inclass 8)
   (c-set-offset 'knr-argdecl-intro 8)
+
+  ;; Basic indent is 8 spaces
+  (setq c-basic-offset 8)
+  (setq tab-width 8)
+
+  ;; Continuation lines are indented 4 spaces
+  (c-set-offset 'arglist-cont 4)
+  (c-set-offset 'arglist-cont-nonempty 4)
+  (c-set-offset 'statement-cont 4)
+  (c-set-offset 'cpp-macro-cont 8)
+
+  ;; Labels are flush to the left
+  (c-set-offset 'label [0])
+
+  ;; Fill column
+  (setq fill-column 74))
   )


More information about the cvs-all mailing list