-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathff-c-style.el
142 lines (124 loc) · 3.77 KB
/
ff-c-style.el
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
;;; ff-c-style.el --- My personal c style
;; Copyright (C) 2010-2019 Björn Larsson
;; Author: Björn Larsson <[email protected]>
;; Maintainer: Björn Larsson <[email protected]>
;; Created: 2019-12-01
;; Keywords: styles
;; Homepage:
;; This file is not part of GNU Emacs.
;;; Commentary:
;;; code:
;;;###autoload
(defconst ff-c-style
'((fill-column . 120)
(whitespace-line-column . 120)
(c-comment-only-line-offset . 0)
(indent-tabs-mode . t)
(tab-width . 4)
(c-basic-offset . 4)
(tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60))
(c-offsets-alist
(access-label . -)
(arglist-cont . 0)
(arglist-intro . +)
(block-close . 0)
(defun-block-intro . +)
(defun-close . 0)
(else-clause . 0)
(inline-close . 0)
(innamespace . +)
(member-init-cont . -)
(member-init-intro . +)
(namespace-close . 0)
(statement . 0)
(statement-block-intro . +)
(statement-cont . -)
(topmost-intro . 0)
(topmost-intro-cont . 0)
(access-label . -)
(annotation-top-cont . 0)
(annotation-var-cont . +)
(arglist-close . c-lineup-close-paren)
(arglist-cont-nonempty . c-lineup-arglist)
(block-open . 0)
(brace-entry-open . 0)
(brace-list-close . -)
(brace-list-entry . 0)
(brace-list-intro . 0)
(brace-list-open . 0)
(c . c-lineup-C-comments)
(case-label . +)
(catch-clause . 0)
(class-close . 0)
(class-open . 0)
(comment-intro . c-lineup-comment)
(composition-close . 0)
(composition-open . 0)
(cpp-define-intro c-lineup-cpp-define +)
(cpp-macro . -1000)
(cpp-macro-cont . 0)
(defun-open . 0)
(do-while-closure . 0)
(extern-lang-close . 0)
(extern-lang-open . 0)
(friend . 0)
(func-decl-cont . +)
(inclass . +)
(incomposition . +)
(inexpr-class . +)
(inexpr-statement . +)
(inextern-lang . +)
(inher-cont . c-lineup-multi-inher)
(inher-intro . +)
(inlambda . 0)
(inline-open . 0)
(inmodule . +)
(knr-argdecl . 0)
(knr-argdecl-intro . 0)
(label . 0)
(lambda-intro-cont . +)
(module-close . 0)
(module-open . 0)
(namespace-open . 0)
(objc-method-args-cont . c-lineup-ObjC-method-args)
(objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-method-call +)
(objc-method-intro . [0])
(statement-case-intro . +)
(statement-case-open . 0)
(stream-op . c-lineup-streamop)
(string . -1000)
(substatement . +)
(substatement-label . 0)
(substatement-open . 0)
(template-args-cont c-lineup-template-args +))
;; Control brace placement
(c-hanging-braces-alist .
((block-close . c-snug-do-while)
(substatement-open . (after))
(namespace-open . (after))
(namespace-close . (before after))
(class-open . (after))
(extern-lang-open . (after))))
(c-hanging-colons-alist .
((case-label)
(label after)
(access-label after)
(member-init-intro before)
(inher-intro)))
(c-cleanup-list .
(scope-operator
defun-close-semi
empty-defun-braces)))
"FF C Style Guide.")
;;;###autoload
(defun ff-add-c-style ()
"Add ff-c-style."
(interactive)
(c-add-style "FF" ff-c-style nil))
;;;###autoload
(defun ff-set-c-style ()
"Add and set the current style to ff-c-style."
(interactive)
(c-add-style "FF" ff-c-style t))
(provide 'ff-c-style)
;;; ff-c-style.el ends here