all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#6617: linux kernel C style (fwd)
@ 2010-07-12 10:08 Dimitrios Apostolou
  2010-07-13  8:51 ` Dan Nicolaescu
  0 siblings, 1 reply; 11+ messages in thread
From: Dimitrios Apostolou @ 2010-07-12 10:08 UTC (permalink / raw)
  To: 6617

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






^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-04-27 19:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-12 10:08 bug#6617: linux kernel C style (fwd) Dimitrios Apostolou
2010-07-13  8:51 ` Dan Nicolaescu
2010-07-13  9:17   ` Dimitrios Apostolou
2010-07-13 12:51     ` Dan Nicolaescu
2021-09-08  8:40   ` Lars Ingebrigtsen
2021-09-08 18:29     ` Sean Whitton
2021-09-09 14:00       ` Lars Ingebrigtsen
2022-04-18 18:30         ` Sean Whitton
2022-04-24 14:50           ` Alan Mackenzie
2022-04-24 21:16             ` Sean Whitton
2022-04-27 19:17               ` Alan Mackenzie

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.