2005-04-24 17:09:19 +00:00
|
|
|
;; LLVM coding style guidelines in emacs
|
2006-03-14 06:05:05 +00:00
|
|
|
;; Maintainer: LLVM Team, http://llvm.org/
|
2005-04-24 17:09:19 +00:00
|
|
|
|
2014-12-09 08:58:31 +00:00
|
|
|
;; Add a cc-mode style for editing LLVM C++ code
|
2009-03-04 14:14:37 +00:00
|
|
|
(c-add-style "llvm.org"
|
|
|
|
'((fill-column . 80)
|
|
|
|
(c++-indent-level . 2)
|
|
|
|
(c-basic-offset . 2)
|
2009-07-28 17:34:57 +00:00
|
|
|
(indent-tabs-mode . nil)
|
2014-12-09 08:58:31 +00:00
|
|
|
(c-offsets-alist . ((arglist-intro . ++)
|
|
|
|
(innamespace . 0)
|
|
|
|
(member-init-intro . ++)
|
|
|
|
))
|
|
|
|
))
|
2009-07-28 17:34:57 +00:00
|
|
|
|
2014-12-09 08:58:31 +00:00
|
|
|
;; Files with "llvm" in their names will automatically be set to the
|
|
|
|
;; llvm.org coding style.
|
2009-03-04 14:14:37 +00:00
|
|
|
(add-hook 'c-mode-hook
|
|
|
|
(function
|
|
|
|
(lambda nil
|
|
|
|
(if (string-match "llvm" buffer-file-name)
|
|
|
|
(progn
|
|
|
|
(c-set-style "llvm.org")
|
|
|
|
)
|
|
|
|
))))
|
2009-07-28 17:34:57 +00:00
|
|
|
|
2009-03-04 14:14:37 +00:00
|
|
|
(add-hook 'c++-mode-hook
|
|
|
|
(function
|
|
|
|
(lambda nil
|
|
|
|
(if (string-match "llvm" buffer-file-name)
|
|
|
|
(progn
|
|
|
|
(c-set-style "llvm.org")
|
|
|
|
)
|
|
|
|
))))
|