summaryrefslogtreecommitdiffstats
path: root/llvm/utils/emacs/emacs.el
diff options
context:
space:
mode:
authorWill Newton <will.newton@linaro.org>2014-12-09 08:58:31 +0000
committerWill Newton <will.newton@linaro.org>2014-12-09 08:58:31 +0000
commit3b7d03b3327e44f4c63e2eca2713aa2b9f7293c8 (patch)
tree8ea55ca22e351ce55130e680dabd8a85ee744aba /llvm/utils/emacs/emacs.el
parent7415205113f8c473dc2f84a7cd72700d84fe2459 (diff)
downloadbcm5719-llvm-3b7d03b3327e44f4c63e2eca2713aa2b9f7293c8.tar.gz
bcm5719-llvm-3b7d03b3327e44f4c63e2eca2713aa2b9f7293c8.zip
Improve emacs coding style
Remove setting of default style, this way is not recommended and means that all the settings have to be duplicated to demonstrate the c-add-style method which is a much better way of doing it. Remove the modified date as it is better stored in SVN. Tweak a few style parameters to make them conform to the actual LLVM style. llvm-svn: 223765
Diffstat (limited to 'llvm/utils/emacs/emacs.el')
-rw-r--r--llvm/utils/emacs/emacs.el21
1 files changed, 8 insertions, 13 deletions
diff --git a/llvm/utils/emacs/emacs.el b/llvm/utils/emacs/emacs.el
index 969f538c817..2ebc3c677ce 100644
--- a/llvm/utils/emacs/emacs.el
+++ b/llvm/utils/emacs/emacs.el
@@ -1,25 +1,20 @@
;; LLVM coding style guidelines in emacs
;; Maintainer: LLVM Team, http://llvm.org/
-;; Modified: 2009-07-28
-;; Max 80 cols per line, indent by two spaces, no tabs.
-;; Apparently, this does not affect tabs in Makefiles.
-(custom-set-variables
- '(fill-column 80)
- '(c++-indent-level 2)
- '(c-basic-offset 2)
- '(indent-tabs-mode nil))
-
-
-;; Alternative to setting the global style. Only files with "llvm" in
-;; their names will automatically set to the llvm.org coding style.
+;; Add a cc-mode style for editing LLVM C++ code
(c-add-style "llvm.org"
'((fill-column . 80)
(c++-indent-level . 2)
(c-basic-offset . 2)
(indent-tabs-mode . nil)
- (c-offsets-alist . ((innamespace 0)))))
+ (c-offsets-alist . ((arglist-intro . ++)
+ (innamespace . 0)
+ (member-init-intro . ++)
+ ))
+ ))
+;; Files with "llvm" in their names will automatically be set to the
+;; llvm.org coding style.
(add-hook 'c-mode-hook
(function
(lambda nil
OpenPOWER on IntegriCloud