Subject: Re: emacs and knf
To: Yuji Yamano <>
From: Brett Lymn <>
List: current-users
Date: 09/15/2000 22:18:58
According to Yuji Yamano:
>No, I think we don't have it. Does anyone try to use the emacs 
>file and please let us your thought?

I think I do - I forced myself to make one because doing my own thing
and the chucking it through indent sucked rocks big time.

>> 	If so, where should it live - /usr/share/misc/style.???
>/usr/share/misc/ ?

Sounds good to me.  Here is my .emacs FWIW:

 '(c-hanging-braces-alist (quote ((substatement-open after) (brace-list-open after))))
 '(c-basic-offset 8)
 '(c-comment-continuation-stars "*")
 '(c-backslash-column 78)
 '(c-indent-comments-syntactically-p t)
 '(c-comment-only-line-offset 0)
 '(c-label-minimum-indentation 0)
 '(c-hanging-comment-ender-p nil)
 '(c-hanging-comment-starter-p nil)
 '(global-font-lock-mode t nil (font-lock))
 '(c-hanging-colons-alist (quote ((inher-intro after) (member-init-intro after) (access-label after) (label after) (case-label after)))))
 '(show-paren-mismatch-face ((((class color)) (:foreground "white" :background "purple"))))
 '(show-paren-match-face ((((class color)) (:background "turquoise"))))
 '(makefile-space-face ((((class color)) (:background "hotpink")))))
(defconst my-c-style
  '((c-tab-always-indent        . t)
    (c-comment-only-line-offset . 2)
    (c-hanging-braces-alist     . ((substatement-open after)
    (c-hanging-colons-alist     . ((member-init-intro before)
                                   (case-label after)
                                   (label after)
                                   (access-label after)))
    (c-cleanup-list             . (scope-operator
    (c-offsets-alist            . ((arglist-close . c-lineup-arglist)
                                   (substatement-open . 0)
                                   (case-label        . 0)
                                   (block-open        . 0)
                                   (knr-argdecl-intro . 8)))
    (c-echo-syntactic-information-p . t)
  "My C Programming Style")

;; 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 "PERSONAL" my-c-style t)
  ;; offset customizations not in my-c-style
  (c-set-offset 'member-init-intro '++)
  ;; other customizations
  (setq tab-width 8
        indent-tabs-mode t)
  ;; we like auto-newline and hungry-delete
  (c-toggle-auto-hungry-state 1)
  ;; keybindings for all supported languages.  We can put these in
  ;; c-mode-base-map because c-mode-map, c++-mode-map, objc-mode-map,
  ;; java-mode-map, and idl-mode-map inherit from it.
  (define-key c-mode-base-map "\C-m" 'newline-and-indent)

(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

Brett Lymn, Computer Systems Administrator, BAE SYSTEMS