Switch .dir-locals.el to linux kernel style

We have a non ideal configuration for different editors.
The project uses linux style - emacs config should also
correspond to that.

Taken from
https://www.kernel.org/doc/html/v6.13/process/coding-style.html#you-ve-made-a-mess-of-it
with the attempt to update for c++.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
This commit is contained in:
Bernd Schubert
2025-02-20 13:47:48 +01:00
parent b9fc5a0ff8
commit bdddba72c2
+52 -35
View File
@@ -1,47 +1,64 @@
((python-mode . ((indent-tabs-mode . nil)))
(autoconf-mode . ((indent-tabs-mode . t)))
(c++-mode . ((c-file-style . "k&r")
(indent-tabs-mode . nil)
(c-basic-offset . 4)
(c-file-offsets .
((block-close . 0)
(brace-list-close . 0)
(brace-list-entry . 0)
(brace-list-intro . +)
(case-label . 0)
(class-close . 0)
(defun-block-intro . +)
(defun-close . 0)
(defun-open . 0)
(else-clause . 0)
(inclass . +)
(label . 0)
(statement . 0)
(statement-block-intro . +)
(statement-case-intro . +)
(statement-cont . +)
(substatement . +)
(topmost-intro . 0)))))
(c-mode . ((c-file-style . "stroustrup")
(indent-tabs-mode . t)
(tab-width . 8)
(c++-mode . ((c-file-style . "linux-kernel")
(c-basic-offset . 8)
(c-file-offsets .
((block-close . 0)
(brace-list-close . 0)
(brace-list-entry . 0)
(c-label-minimum-indentation . 0)
(c-offsets-alist . (
(arglist-close . c-lineup-arglist-tabs-only)
(arglist-cont-nonempty .
(c-lineup-gcc-asm-reg c-lineup-arglist-tabs-only))
(arglist-intro . +)
(brace-list-intro . +)
(c . c-lineup-C-comments)
(case-label . 0)
(class-close . 0)
(comment-intro . c-lineup-comment)
(cpp-define-intro . +)
(cpp-macro . -1000)
(cpp-macro-cont . +)
(defun-block-intro . +)
(defun-close . 0)
(defun-open . 0)
(else-clause . 0)
(func-decl-cont . +)
(inclass . +)
(label . 0)
(inher-cont . c-lineup-multi-inher)
(knr-argdecl-intro . 0)
(label . -1000)
(statement . 0)
(statement-block-intro . +)
(statement-case-intro . +)
(statement-cont . +)
(substatement . +)
(topmost-intro . 0))))))
))
(indent-tabs-mode . t)
(show-trailing-whitespace . t)
))
(c-mode . ((c-file-style . "linux-kernel")
(c-basic-offset . 8)
(c-label-minimum-indentation . 0)
(c-offsets-alist . (
(arglist-close . c-lineup-arglist-tabs-only)
(arglist-cont-nonempty .
(c-lineup-gcc-asm-reg c-lineup-arglist-tabs-only))
(arglist-intro . +)
(brace-list-intro . +)
(c . c-lineup-C-comments)
(case-label . 0)
(comment-intro . c-lineup-comment)
(cpp-define-intro . +)
(cpp-macro . -1000)
(cpp-macro-cont . +)
(defun-block-intro . +)
(else-clause . 0)
(func-decl-cont . +)
(inclass . +)
(inher-cont . c-lineup-multi-inher)
(knr-argdecl-intro . 0)
(label . -1000)
(statement . 0)
(statement-block-intro . +)
(statement-case-intro . +)
(statement-cont . +)
(substatement . +)
))
(indent-tabs-mode . t)
(show-trailing-whitespace . t)
))
)