Subject: bug#6617: closed (Re: bug#6617: linux kernel C style (fwd))

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 27 Apr 2022 19:19:02 +0000

Your bug report

#6617: linux kernel C style (fwd)

which was filed against the emacs,cc-mode package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
6617: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=6617
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#6617: linux kernel C style (fwd)
From: Alan Mackenzie <[email-masked]>
To: Sean Whitton <[email-masked]>
Cc: Dan Nicolaescu <[email-masked]>, Lars Ingebrigtsen <[email-masked]>, [email-masked], Dimitrios Apostolou <[email-masked]>, [email-masked]
Date: Wed, 27 Apr 2022 19:17:52 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello, everybody.

On Sun, Apr 24, 2022 at 14:16:23 -0700, Sean Whitton wrote:
> Hello Alan,

> On Sun 24 Apr 2022 at 02:50PM GMT, Alan Mackenzie wrote:

> > After a bit of thought, I agree with you.  I think here it is better
> > just to add the setting of indent-tabs-mode to the "linux" style.  Most
> > users of "linux" will have that variable set to t one way or another,
> > and so won't notice.

> > There will be a few users using the style for non-Linux projects, who
> > will be used to indent-tabs-mode being nil.  That is just unfortunate.
> > I think the balance of benefits and problems comes down on the side of
> > this abrupt change.

> Right.

> > I intend to apply the following patch to cc-styles.el soon.  If you
> > want to test it you're very welcome, but please note that since it
> > changes a variable, the amended CC Mode should be the first CC Mode
> > you load in the Emacs session.  (Otherwise, you'll need to do fancy
> > things with `makunbound' before loading the new CC Mode.)

> I'm not in the middle of any C projects using the Linux style atm, so I
> don't think I'll be able to test, but your patch looks basically
> equivalent to the "linux-tabs" thing I was doing, so probably doesn't
> need a lot of testing.  Thanks for thinking this one over!

I've now committed the change to cc-styles.el, and am closing the bug
with this post.

> -- 
> Sean Whitton

-- 
Alan Mackenzie (Nuremberg, Germany).

Subject: linux kernel C style (fwd)
From: Dimitrios Apostolou <[email-masked]>
To: [email-masked]
Date: Mon, 12 Jul 2010 13:08:42 +0300 (EEST)
List-Id: <debbugs-submit.debbugs.gnu.org>

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 <[email-masked]>
To: [email-masked]
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