summaryrefslogtreecommitdiff
path: root/graphics/asymptote/cc-mode2.el
blob: e3eb041d6ab47142530852138184e458531db732 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(when (require 'cc-mode nil t)
  (require 'asy-mode nil t)

  (defvar my-c-style '((c-basic-offset . 2)
		       (c-tab-always-indent . nil)
                       (c-offsets-alist . ((innamespace nil)
                                           (inline-open nil)
                                           (case-label +)
                                           ))
                       (c-cleanup-list . (brace-else-brace
                                          brace-else-if-brace
                                          brace-catch-brace
                                          empty-defun-braces
                                          defun-close-semi))
                       (c-hanging-braces-alist . ((brace-list-open)
                                                  (brace-entry-open)
                                                  (statement-cont)
                                                  (substatement-open after)
                                                  (block-close . c-snug-do-while)
                                                  (extern-lang-open after)
                                                  (inline-open)
                                                  (inline-close)
                                                  (namespace-open after)))
                       (c-hanging-semi&comma-criteria . (c-semi&comma-no-newlines-for-oneline-inliners
                                                         c-semi&comma-no-newlines-before-nonblanks
                                                         c-semi&comma-inside-parenlist))
                       ))

  (setq c-mode-hook 'c++-mode)

  (defun c-mode-common-addn() "Additions to c-and-c++-mode."
    (c-add-style "jcb" my-c-style t)
;;    (c-toggle-auto-hungry-state 1)
    (auto-fill-mode)
    )

  (setq c-mode-common-hook 'c-mode-common-addn)
  )