From: Dimitrios Apostolou <jimis@gmx.net>
To: 6617@debbugs.gnu.org
Subject: bug#6617: linux kernel C style (fwd)
Date: Mon, 12 Jul 2010 13:08:42 +0300 (EEST) [thread overview]
Message-ID: <alpine.LNX.2.00.1007121306420.1500@localhost.localdomain> (raw)
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
next reply other threads:[~2010-07-12 10:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-12 10:08 Dimitrios Apostolou [this message]
2010-07-13 8:51 ` bug#6617: linux kernel C style (fwd) 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LNX.2.00.1007121306420.1500@localhost.localdomain \
--to=jimis@gmx.net \
--cc=6617@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).