[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6617: linux kernel C style (fwd)
From: |
Dimitrios Apostolou |
Subject: |
bug#6617: linux kernel C style (fwd) |
Date: |
Mon, 12 Jul 2010 13:08:42 +0300 (EEST) |
User-agent: |
Alpine 2.00 (LNX 1167 2008-08-23) |
Hi, I sent the following to help-gnu-emacs and got no reply, maybe this
list is more relevant.
---------- Forwarded message ----------
Date: Thu, 8 Jul 2010 21:56:09 +0300 (EEST)
From: Dimitrios Apostolou <jimis@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: linux kernel C style
Hello list,
is the "linux" c-style supposed to be compliant to the linux kernel style
guidelines? I just realised that all this time emacs was indenting my code
slightly wrong, specifically the use of spaces is forbidden, even when
continuing the argument list of a function.
I use the following lines in my .emacs, taken from Documentation/CodingStyle of
the kernel tree. Perhaps they should be added to "linux" style?
(defun c-lineup-arglist-tabs-only (ignored)
"Line up argument lists by tabs, not spaces"
(let* ((anchor (c-langelem-pos c-syntactic-element))
(column (c-langelem-2nd-pos c-syntactic-element))
(offset (- (1+ column) anchor))
(steps (floor offset c-basic-offset)))
(* (max steps 1)
c-basic-offset)))
;; Add kernel style
(c-add-style
"linux-tabs-only"
'("linux" (c-offsets-alist
(arglist-cont-nonempty
c-lineup-gcc-asm-reg
c-lineup-arglist-tabs-only))))
(custom-set-variables
'(c-default-style "linux-tabs-only")
)
Thanks,
Dimitris
- bug#6617: linux kernel C style (fwd),
Dimitrios Apostolou <=