all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Sean Whitton <spwhitton@spwhitton.name>
Cc: Dan Nicolaescu <dann@gnu.org>, Lars Ingebrigtsen <larsi@gnus.org>,
	Dimitrios Apostolou <jimis@gmx.net>,
	6617@debbugs.gnu.org, acm@muc.de
Subject: bug#6617: linux kernel C style (fwd)
Date: Sun, 24 Apr 2022 14:50:42 +0000	[thread overview]
Message-ID: <YmVjwo3rtZMaNU1e@ACM> (raw)
In-Reply-To: <87r15uxn0z.fsf@melete.silentflame.com>

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





  reply	other threads:[~2022-04-24 14:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmVjwo3rtZMaNU1e@ACM \
    --to=acm@muc.de \
    --cc=6617@debbugs.gnu.org \
    --cc=dann@gnu.org \
    --cc=jimis@gmx.net \
    --cc=larsi@gnus.org \
    --cc=spwhitton@spwhitton.name \
    /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 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.