GNU bug report logs - #6617
linux kernel C style (fwd)

Previous Next

Packages: emacs, cc-mode;

Reported by: Dimitrios Apostolou <jimis <at> gmx.net>

Date: Mon, 12 Jul 2010 10:36:01 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6617 in the body.
You can then email your comments to 6617 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6617; Package emacs. (Mon, 12 Jul 2010 10:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dimitrios Apostolou <jimis <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 12 Jul 2010 10:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dimitrios Apostolou <jimis <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: linux kernel C style (fwd)
Date: Mon, 12 Jul 2010 13:08:42 +0300 (EEST)
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 <at> gmx.net>
To: help-gnu-emacs <at> 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





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#6617; Package emacs,cc-mode. (Tue, 13 Jul 2010 08:52:02 GMT) Full text and rfc822 format available.

Message #8 received at 6617 <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: Dimitrios Apostolou <jimis <at> gmx.net>
Cc: 6617 <at> debbugs.gnu.org
Subject: Re: bug#6617: linux kernel C style (fwd)
Date: Tue, 13 Jul 2010 04:51:17 -0400
Dimitrios Apostolou <jimis <at> gmx.net> 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 <jimis <at> gmx.net>
> To: help-gnu-emacs <at> 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.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#6617; Package emacs,cc-mode. (Tue, 13 Jul 2010 10:18:02 GMT) Full text and rfc822 format available.

Message #11 received at 6617 <at> debbugs.gnu.org (full text, mbox):

From: Dimitrios Apostolou <jimis <at> gmx.net>
To: Dan Nicolaescu <dann <at> gnu.org>
Cc: 6617 <at> debbugs.gnu.org
Subject: Re: bug#6617: linux kernel C style (fwd)
Date: Tue, 13 Jul 2010 12:17:38 +0300 (EEST)
On Tue, 13 Jul 2010, Dan Nicolaescu wrote:
> Dimitrios Apostolou <jimis <at> gmx.net> 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 <jimis <at> gmx.net>
>> To: help-gnu-emacs <at> 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?

In the file Documentation/CodingStyle search for "emacs". Warning: the 
language is a bit toxic for emacs devs/users.

There is also another point which is not clear but says the following:

Statements longer than 80 columns will be broken into sensible chunks. 
Descendants are always substantially shorter than the parent and are 
placed substantially to the right. The same applies to function headers 
with a long argument list. Long strings are as well broken into shorter 
strings. The only exception to this is where exceeding 80 columns 
significantly increases readability and does not hide information.


It is then followed by an example which is is indented only with tabs.


> 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.

My guess is that those are inconsistencies caused by the current "linux" 
style in emacs, but perhaps this should be posted to LKML to verify.

>
>
> 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.
>
>



Thanks,
Dimitris





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#6617; Package emacs,cc-mode. (Tue, 13 Jul 2010 12:52:01 GMT) Full text and rfc822 format available.

Message #14 received at 6617 <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: Dimitrios Apostolou <jimis <at> gmx.net>
Cc: 6617 <at> debbugs.gnu.org
Subject: Re: bug#6617: linux kernel C style (fwd)
Date: Tue, 13 Jul 2010 08:51:30 -0400
Dimitrios Apostolou <jimis <at> gmx.net> writes:

> On Tue, 13 Jul 2010, Dan Nicolaescu wrote:
>> Dimitrios Apostolou <jimis <at> gmx.net> 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 <jimis <at> gmx.net>
>>> To: help-gnu-emacs <at> 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?
>
> In the file Documentation/CodingStyle search for "emacs". Warning: the
> language is a bit toxic for emacs devs/users.

There's code there that seems to do what you stated, but there seems
to be no text that actually describes that...

> There is also another point which is not clear but says the following:
>
> Statements longer than 80 columns will be broken into sensible
> chunks. Descendants are always substantially shorter than the parent
> and are placed substantially to the right. The same applies to
> function headers with a long argument list. Long strings are as well
> broken into shorter strings. The only exception to this is where
> exceeding 80 columns significantly increases readability and does not
> hide information.
>
>
> It is then followed by an example which is is indented only with tabs.
>
>
>> 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.
>
> My guess is that those are inconsistencies caused by the current
> "linux" style in emacs, but perhaps this should be posted to LKML to
> verify.

Please do that and report the conclusion here.

>> 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.
>>
>>
>
>
>
> Thanks,
> Dimitris




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#6617; Package emacs,cc-mode. (Wed, 08 Sep 2021 08:41:01 GMT) Full text and rfc822 format available.

Message #17 received at 6617 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dan Nicolaescu <dann <at> gnu.org>
Cc: Alan Mackenzie <acm <at> muc.de>, Dimitrios Apostolou <jimis <at> gmx.net>,
 6617 <at> debbugs.gnu.org
Subject: Re: bug#6617: linux kernel C style (fwd)
Date: Wed, 08 Sep 2021 10:40:31 +0200
Dan Nicolaescu <dann <at> gnu.org> writes:

> Statements longer than 80 columns will be broken into sensible
> chunks. Descendants are always substantially shorter than the parent
> and are placed substantially to the right. The same applies to
> function headers with a long argument list. Long strings are as well
> broken into shorter strings. The only exception to this is where
> exceeding 80 columns significantly increases readability and does not
> hide information.
>
> It is then followed by an example which is is indented only with tabs.
>
>> 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)
>> {

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

It still seems to be the case that the "linux" style indents using both
tabs and spaces in Emacs 28.  I don't know what the Linux kernel style
is these days, but the suggestion in this bug report is to add a
tab-only variant.  Alan, do you have any comments about this?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#6617; Package emacs,cc-mode. (Wed, 08 Sep 2021 18:30:02 GMT) Full text and rfc822 format available.

Message #20 received at 6617 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Dan Nicolaescu <dann <at> gnu.org>
Cc: Alan Mackenzie <acm <at> muc.de>, Dimitrios Apostolou <jimis <at> gmx.net>,
 6617 <at> debbugs.gnu.org
Subject: Re: bug#6617: linux kernel C style (fwd)
Date: Wed, 08 Sep 2021 11:29:10 -0700
Hello,

On Wed 08 Sep 2021 at 10:40AM +02, Lars Ingebrigtsen wrote:

> Dan Nicolaescu <dann <at> gnu.org> writes:
>
>> Statements longer than 80 columns will be broken into sensible
>> chunks. Descendants are always substantially shorter than the parent
>> and are placed substantially to the right. The same applies to
>> function headers with a long argument list. Long strings are as well
>> broken into shorter strings. The only exception to this is where
>> exceeding 80 columns significantly increases readability and does not
>> hide information.
>>
>> It is then followed by an example which is is indented only with tabs.
>>
>>> 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)
>>> {
>
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> It still seems to be the case that the "linux" style indents using both
> tabs and spaces in Emacs 28.  I don't know what the Linux kernel style
> is these days, but the suggestion in this bug report is to add a
> tab-only variant.  Alan, do you have any comments about this?

The Linux kernel style is tabs only.  I think that Emacs DTRT if
indent-tabs-mode is t.  So, currently I have this fix in my init file:

    (c-add-style "linux-tabs" '("linux" (indent-tabs-mode . t)))
    (setq c-default-style "linux-tabs")

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#6617; Package emacs,cc-mode. (Thu, 09 Sep 2021 14:01:02 GMT) Full text and rfc822 format available.

Message #23 received at 6617 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: Dan Nicolaescu <dann <at> gnu.org>, Dimitrios Apostolou <jimis <at> gmx.net>,
 6617 <at> debbugs.gnu.org, Alan Mackenzie <acm <at> muc.de>
Subject: Re: bug#6617: linux kernel C style (fwd)
Date: Thu, 09 Sep 2021 16:00:09 +0200
Sean Whitton <spwhitton <at> spwhitton.name> writes:

> The Linux kernel style is tabs only.  I think that Emacs DTRT if
> indent-tabs-mode is t.  So, currently I have this fix in my init file:
>
>     (c-add-style "linux-tabs" '("linux" (indent-tabs-mode . t)))
>     (setq c-default-style "linux-tabs")

Right.  Alan, would it make sense to add this style to c-mode?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#6617; Package emacs,cc-mode. (Mon, 18 Apr 2022 18:31:02 GMT) Full text and rfc822 format available.

Message #26 received at 6617 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Dan Nicolaescu <dann <at> gnu.org>, Dimitrios Apostolou <jimis <at> gmx.net>,
 6617 <at> debbugs.gnu.org, Alan Mackenzie <acm <at> muc.de>
Subject: Re: bug#6617: linux kernel C style (fwd)
Date: Mon, 18 Apr 2022 11:30:04 -0700
Hello,

On Thu 09 Sep 2021 at 04:00PM +02, Lars Ingebrigtsen wrote:

> Sean Whitton <spwhitton <at> spwhitton.name> writes:
>
>> The Linux kernel style is tabs only.  I think that Emacs DTRT if
>> indent-tabs-mode is t.  So, currently I have this fix in my init file:
>>
>>     (c-add-style "linux-tabs" '("linux" (indent-tabs-mode . t)))
>>     (setq c-default-style "linux-tabs")
>
> Right.  Alan, would it make sense to add this style to c-mode?

Were you thinking it would be too much of a compat break to just edit
the linux style to include setting indent-tabs-mode?  I think that would
be a lot more useful.  Anyone who actually wants the Linux kernel's
style would want (what I've called) linux-tabs.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#6617; Package emacs,cc-mode. (Sun, 24 Apr 2022 14:51:02 GMT) Full text and rfc822 format available.

Message #29 received at 6617 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: Dan Nicolaescu <dann <at> gnu.org>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Dimitrios Apostolou <jimis <at> gmx.net>, 6617 <at> debbugs.gnu.org, acm <at> muc.de
Subject: Re: bug#6617: linux kernel C style (fwd)
Date: Sun, 24 Apr 2022 14:50:42 +0000
Hello, Sean.

On Mon, Apr 18, 2022 at 11:30:04 -0700, Sean Whitton wrote:
> Hello,

> On Thu 09 Sep 2021 at 04:00PM +02, Lars Ingebrigtsen wrote:

> > Sean Whitton <spwhitton <at> spwhitton.name> writes:

> >> The Linux kernel style is tabs only.  I think that Emacs DTRT if
> >> indent-tabs-mode is t.  So, currently I have this fix in my init file:

> >>     (c-add-style "linux-tabs" '("linux" (indent-tabs-mode . t)))
> >>     (setq c-default-style "linux-tabs")

> > Right.  Alan, would it make sense to add this style to c-mode?

> Were you thinking it would be too much of a compat break to just edit
> the linux style to include setting indent-tabs-mode?  I think that would
> be a lot more useful.  Anyone who actually wants the Linux kernel's
> style would want (what I've called) linux-tabs.

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.

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.)



diff -r 8fd64e3084ac cc-styles.el
--- a/cc-styles.el	Sat Apr 23 19:17:52 2022 +0000
+++ b/cc-styles.el	Sun Apr 24 14:36:46 2022 +0000
@@ -187,6 +187,7 @@
 			 (inclass              . +)
 			 (inline-open          . 0))))
     ("linux"
+     (indent-tabs-mode . t)
      (c-basic-offset  . 8)
      (c-comment-only-line-offset . 0)
      (c-hanging-braces-alist . ((brace-list-open)


> -- 
> Sean Whitton

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#6617; Package emacs,cc-mode. (Sun, 24 Apr 2022 21:17:02 GMT) Full text and rfc822 format available.

Message #32 received at 6617 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Dan Nicolaescu <dann <at> gnu.org>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Dimitrios Apostolou <jimis <at> gmx.net>, 6617 <at> debbugs.gnu.org, acm <at> muc.de
Subject: Re: bug#6617: linux kernel C style (fwd)
Date: Sun, 24 Apr 2022 14:16:23 -0700
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!

-- 
Sean Whitton




Reply sent to Alan Mackenzie <acm <at> muc.de>:
You have taken responsibility. (Wed, 27 Apr 2022 19:19:02 GMT) Full text and rfc822 format available.

Notification sent to Dimitrios Apostolou <jimis <at> gmx.net>:
bug acknowledged by developer. (Wed, 27 Apr 2022 19:19:02 GMT) Full text and rfc822 format available.

Message #37 received at 6617-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: Dan Nicolaescu <dann <at> gnu.org>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 acm <at> muc.de, Dimitrios Apostolou <jimis <at> gmx.net>, 6617-done <at> debbugs.gnu.org
Subject: Re: bug#6617: linux kernel C style (fwd)
Date: Wed, 27 Apr 2022 19:17:52 +0000
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).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 26 May 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.