llvm.org GIT mirror llvm / c429da8
[emacs] Use c-mode-common-hook, derive from "gnu" Make it clear that the "llvm.org" style is deriving from "gnu" style, and use the c-mode-common-hook instead of c-mode-hook and c++-mode-hook. Differential Revision: http://reviews.llvm.org/D7035 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226861 91177308-0d34-0410-b5e6-96231b3b80d8 Ramkumar Ramachandra 4 years ago
1 changed file(s) with 6 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
0 ;; LLVM coding style guidelines in emacs
11 ;; Maintainer: LLVM Team, http://llvm.org/
22
3 ;; Add a cc-mode style for editing LLVM C++ code
3 ;; Add a cc-mode style for editing LLVM C and C++ code
44 (c-add-style "llvm.org"
5 '((fill-column . 80)
5 '("gnu"
6 (fill-column . 80)
67 (c++-indent-level . 2)
78 (c-basic-offset . 2)
89 (indent-tabs-mode . nil)
910 (c-offsets-alist . ((arglist-intro . ++)
1011 (innamespace . 0)
11 (member-init-intro . ++)
12 ))
13 ))
12 (member-init-intro . ++)))))
1413
1514 ;; Files with "llvm" in their names will automatically be set to the
1615 ;; llvm.org coding style.
17 (add-hook 'c-mode-hook
16 (add-hook 'c-mode-common-hook
1817 (function
1918 (lambda nil
2019 (if (string-match "llvm" buffer-file-name)
2120 (progn
22 (c-set-style "llvm.org")
23 )
24 ))))
25
26 (add-hook 'c++-mode-hook
27 (function
28 (lambda nil
29 (if (string-match "llvm" buffer-file-name)
30 (progn
31 (c-set-style "llvm.org")
32 )
33 ))))
21 (c-set-style "llvm.org"))))))