* linux kernel C style
@ 2010-07-08 18:56 Dimitrios Apostolou
0 siblings, 0 replies; only message in thread
From: Dimitrios Apostolou @ 2010-07-08 18:56 UTC (permalink / raw
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-08 18:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-08 18:56 linux kernel C style Dimitrios Apostolou
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.