diff options
author | Mike Stump <mrs@apple.com> | 2009-03-04 14:14:37 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-03-04 14:14:37 +0000 |
commit | 436f0ef9ff8c5626303d62fe881eedfc140d9bc4 (patch) | |
tree | cdde999e47cdb257a521006ac2c876c43e96e203 /llvm/utils/emacs/emacs.el | |
parent | 0874160bd54fe2a9ab5315d1a68449f97af7761d (diff) | |
download | bcm5719-llvm-436f0ef9ff8c5626303d62fe881eedfc140d9bc4.tar.gz bcm5719-llvm-436f0ef9ff8c5626303d62fe881eedfc140d9bc4.zip |
.emacs file bits for automatically setting the llvm.org coding style. Thanks Anton.
llvm-svn: 66032
Diffstat (limited to 'llvm/utils/emacs/emacs.el')
-rw-r--r-- | llvm/utils/emacs/emacs.el | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/utils/emacs/emacs.el b/llvm/utils/emacs/emacs.el index 43e17a7be6a..a12848b4575 100644 --- a/llvm/utils/emacs/emacs.el +++ b/llvm/utils/emacs/emacs.el @@ -10,3 +10,27 @@ '(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. +(c-add-style "llvm.org" + '((fill-column . 80) + (c++-indent-level . 2) + (c-basic-offset . 2) + (indent-tabs-mode . nil))) +(add-hook 'c-mode-hook + (function + (lambda nil + (if (string-match "llvm" buffer-file-name) + (progn + (c-set-style "llvm.org") + ) + )))) +(add-hook 'c++-mode-hook + (function + (lambda nil + (if (string-match "llvm" buffer-file-name) + (progn + (c-set-style "llvm.org") + ) + )))) |