;;
;; cc-mode.el
;;
;; This is a customiced cc mode for GNU emacs and xemacs.
;;
;;------------------------------------------ CVS
;;
;; CVS Headers -- The following headers are generated by the CVS
;; version control system. Note that especially the attribute
;; Author is not necessarily the author of the code.
;;
;; $source: /home/br/CVS/graphlet/src/gt_base/Attributes.h,v $
;; $Author: himsolt $
;; $Revision: 1.2 $
;; $Date: 1999/03/05 20:39:38 $
;; $Locker:  $
;; $State: Exp $
;;
;;------------------------------------------ CVS
;;
;; (C) University of Passau 1995-1999, Graphlet Project
;;

(setq-default c-basic-offset 4)

(defconst passau-c-style
  '((c-tab-always-indent . t)
    (c-comment-only-line-offset . 4)
    (c-hanging-braces-alist . ((substatement-open after)
			       (brace-list-open)))
    (c-hanging-colons-alist . ((member-init-intro before)
			       (inher-intro)
			       (case-label after)
			       (label after)
			       (access-label after)))
    (c-cleanup-list . (scope-operator
		       empty-defun-braces
		       defun-close-semi))
    (c-offsets-alist . (
			(arglist-close . c-lineup-arglist)
			(arglist-cont-nonempty . +)
			(substatement-open . 0)
			(case-label . 4)
			(block-open . 0)
			(knr-argdecl-intro . -)
			(comment-intro . 0)
			)
		     )
    (c-echo-syntactic-information-p . t)
    )
  "Passau")

     
;; Customizations for all of c-mode, c++-mode, and objc-mode

(defun my-c-mode-common-hook ()

  ;; add my personal style and set it for the current buffer
  (c-add-style "Passau" passau-c-style t)

  ;; offset customizations not in my-c-style
  (c-set-offset 'member-init-intro '++)

  ;; other customizations
  (setq ;; this will make sure tabs are used instead of spaces
	indent-tabs-mode t)

  ;; we like auto-newline and hungry-delete
  (c-toggle-hungry-state 1)

  ;; keybindings for C, C++, and Objective-C.  We can put these in
  ;; c-mode-map because c++-mode-map and objc-mode-map inherit it
  ; (define-key c-mode-map "\C-m" 'newline-and-indent)
  )

;; the following only works in Emacs 19
;; Emacs 18ers can use (setq c-mode-common-hook 'my-c-mode-common-hook)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
