From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#6617: linux kernel C style (fwd) Date: Tue, 13 Jul 2010 04:51:17 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1279011631 21958 80.91.229.12 (13 Jul 2010 09:00:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Jul 2010 09:00:31 +0000 (UTC) Cc: 6617@debbugs.gnu.org To: Dimitrios Apostolou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 13 11:00:29 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OYbLo-0007Sl-E3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Jul 2010 11:00:28 +0200 Original-Received: from localhost ([127.0.0.1]:45842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OYbLn-0004xf-QZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Jul 2010 05:00:27 -0400 Original-Received: from [140.186.70.92] (port=49188 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OYbLh-0004wh-T7 for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2010 05:00:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OYbLg-0005pE-AG for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2010 05:00:21 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33950) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OYbLZ-0005oR-CI; Tue, 13 Jul 2010 05:00:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OYbDe-0008EE-33; Tue, 13 Jul 2010 04:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dan Nicolaescu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 13 Jul 2010 08:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6617 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 6617-submit@debbugs.gnu.org id=B6617.127901107531620 (code B ref 6617); Tue, 13 Jul 2010 08:52:02 +0000 Original-Received: (at 6617) by debbugs.gnu.org; 13 Jul 2010 08:51:15 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OYbCs-0008Dx-Sk for submit@debbugs.gnu.org; Tue, 13 Jul 2010 04:51:15 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OYbCq-0008Ds-Nw for 6617@debbugs.gnu.org; Tue, 13 Jul 2010 04:51:13 -0400 Original-Received: from dann by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OYbCv-0004nK-Hh; Tue, 13 Jul 2010 04:51:17 -0400 In-Reply-To: (Dimitrios Apostolou's message of "Mon\, 12 Jul 2010 13\:08\:42 +0300 \(EEST\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 13 Jul 2010 04:52:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38475 Archived-At: Dimitrios Apostolou writes: > 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 > 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. Is that really the case? Is this requirement documented anywhere? Looking at a random file in the linux-2.6.34.1 kernel: kernel/sched.c one can see: static void update_group_shares_cpu(struct task_group *tg, int cpu, unsigned long sd_shares, unsigned long sd_rq_weight, unsigned long *usd_rq_weight) { [snip] The arguments starting from sd_shares are indented using a few tabs followed by a few spaces. The above is not the only occurrence, there are many others in the same file. Another point: to enforce the use of the correct style, a file called .dir-locals.el should be placed at the top level of the kernel tree with the following [completely untested] contents: ((c-mode . ((c-file-style . "linux") (tab-width . 8) (indent-tabs-mode . t)))) With this users of emacs-23+ will get the correct settings for editing the kernel by default.