Misha Brukman | 3e9634e | 2005-04-24 17:09:19 +0000 | [diff] [blame] | 1 | ;; LLVM coding style guidelines in emacs |
Reid Spencer | 552aa01 | 2006-03-14 06:05:05 +0000 | [diff] [blame] | 2 | ;; Maintainer: LLVM Team, http://llvm.org/ |
Misha Brukman | 3e9634e | 2005-04-24 17:09:19 +0000 | [diff] [blame] | 3 | |
Ramkumar Ramachandra | 312beb1 | 2015-01-22 20:56:25 +0000 | [diff] [blame] | 4 | ;; Add a cc-mode style for editing LLVM C and C++ code |
Mike Stump | 436f0ef | 2009-03-04 14:14:37 +0000 | [diff] [blame] | 5 | (c-add-style "llvm.org" |
Ramkumar Ramachandra | 312beb1 | 2015-01-22 20:56:25 +0000 | [diff] [blame] | 6 | '("gnu" |
| 7 | (fill-column . 80) |
Mike Stump | 436f0ef | 2009-03-04 14:14:37 +0000 | [diff] [blame] | 8 | (c++-indent-level . 2) |
| 9 | (c-basic-offset . 2) |
Daniel Dunbar | bca2105 | 2009-07-28 17:34:57 +0000 | [diff] [blame] | 10 | (indent-tabs-mode . nil) |
Will Newton | 3b7d03b | 2014-12-09 08:58:31 +0000 | [diff] [blame] | 11 | (c-offsets-alist . ((arglist-intro . ++) |
| 12 | (innamespace . 0) |
Ramkumar Ramachandra | 312beb1 | 2015-01-22 20:56:25 +0000 | [diff] [blame] | 13 | (member-init-intro . ++))))) |
Daniel Dunbar | bca2105 | 2009-07-28 17:34:57 +0000 | [diff] [blame] | 14 | |
Will Newton | 3b7d03b | 2014-12-09 08:58:31 +0000 | [diff] [blame] | 15 | ;; Files with "llvm" in their names will automatically be set to the |
| 16 | ;; llvm.org coding style. |
Ramkumar Ramachandra | 312beb1 | 2015-01-22 20:56:25 +0000 | [diff] [blame] | 17 | (add-hook 'c-mode-common-hook |
Mike Stump | 436f0ef | 2009-03-04 14:14:37 +0000 | [diff] [blame] | 18 | (function |
| 19 | (lambda nil |
| 20 | (if (string-match "llvm" buffer-file-name) |
| 21 | (progn |
Ramkumar Ramachandra | 312beb1 | 2015-01-22 20:56:25 +0000 | [diff] [blame] | 22 | (c-set-style "llvm.org")))))) |