help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

linux kernel C style


From: Dimitrios Apostolou
Subject: linux kernel C style
Date: Thu, 8 Jul 2010 21:56:09 +0300 (EEST)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]