diff options
| author | Thomas Schneider <qsx@chaotikum.eu> | 2024-09-11 21:47:51 +0200 |
|---|---|---|
| committer | Thomas Schneider <qsx@chaotikum.eu> | 2024-09-11 21:47:51 +0200 |
| commit | 3e1fda8babc53b4dafbf7c64d0b047949ca1ce48 (patch) | |
| tree | 706371ad30de5ab9111d1910ef6abb35b7d9adce /dot.emacs.d | |
| parent | 482106566db3cfdc94e87552ddbe2042a86ac5a9 (diff) | |
Emacs: llvm-mode and llvm.org C style
Diffstat (limited to 'dot.emacs.d')
| -rw-r--r-- | dot.emacs.d/init.el | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/dot.emacs.d/init.el b/dot.emacs.d/init.el index e9896fd..3c1b21d 100644 --- a/dot.emacs.d/init.el +++ b/dot.emacs.d/init.el @@ -276,6 +276,31 @@ (setq c-default-style "linux") +;; Taken from LLVM source tree +;; https://github.com/llvm/llvm-project/blob/c719a8596d01cef9b54f0585bd2d68d657d8659a/llvm/utils/emacs/emacs.el +(defun llvm-lineup-statement (langelem) + (let ((in-assign (c-lineup-assignments langelem))) + (if (not in-assign) + '++ + (aset in-assign 0 + (+ (aref in-assign 0) + (* 2 c-basic-offset))) + in-assign))) + +;; Add a cc-mode style for editing LLVM C and C++ code +(c-add-style "llvm.org" + '("gnu" + (fill-column . 80) + (c++-indent-level . 2) + (c-basic-offset . 2) + (indent-tabs-mode . nil) + (c-offsets-alist . ((arglist-intro . ++) + (innamespace . 0) + (member-init-intro . ++) + (statement-cont . llvm-lineup-statement))))) +;; End LLVM block +(require 'llvm-mode) + (setq tramp-default-method "ssh" tramp-terminal-type "tramp") |
