From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#6617: linux kernel C style (fwd) Date: Sun, 24 Apr 2022 14:50:42 +0000 Message-ID: References: <87ee9z4g00.fsf@gnus.org> <871r5yyl8p.fsf@melete.silentflame.com> <874katvogm.fsf@gnus.org> <87r15uxn0z.fsf@melete.silentflame.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24536"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dan Nicolaescu , Lars Ingebrigtsen , Dimitrios Apostolou , 6617@debbugs.gnu.org, acm@muc.de To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 24 16:51:21 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nida4-00069a-Fl for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Apr 2022 16:51:20 +0200 Original-Received: from localhost ([::1]:59902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nida3-0004RO-4B for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Apr 2022 10:51:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nidZv-0004R5-06 for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2022 10:51:11 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nidZm-0007rK-HR; Sun, 24 Apr 2022 10:51:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nidZm-00046k-GM; Sun, 24 Apr 2022 10:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 24 Apr 2022 14:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6617 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 6617-submit@debbugs.gnu.org id=B6617.165081185115772 (code B ref 6617); Sun, 24 Apr 2022 14:51:02 +0000 Original-Received: (at 6617) by debbugs.gnu.org; 24 Apr 2022 14:50:51 +0000 Original-Received: from localhost ([127.0.0.1]:59911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nidZb-00046K-B3 for submit@debbugs.gnu.org; Sun, 24 Apr 2022 10:50:51 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:12648 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1nidZZ-000465-Ac for 6617@debbugs.gnu.org; Sun, 24 Apr 2022 10:50:49 -0400 Original-Received: (qmail 42044 invoked by uid 3782); 24 Apr 2022 14:50:43 -0000 Original-Received: from acm.muc.de (p2e5d583a.dip0.t-ipconnect.de [46.93.88.58]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 24 Apr 2022 16:50:42 +0200 Original-Received: (qmail 5703 invoked by uid 1000); 24 Apr 2022 14:50:42 -0000 Content-Disposition: inline In-Reply-To: <87r15uxn0z.fsf@melete.silentflame.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:230568 Archived-At: 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 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).