LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Richard Knutsson <ricknu-0@student.ltu.se>
To: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: Tabs, spaces, indent and 80 character lines
Date: Mon, 25 Feb 2008 22:56:18 +0100	[thread overview]
Message-ID: <47C33982.8030902@student.ltu.se> (raw)
In-Reply-To: <m3ablqb6jl.fsf@maximus.localdomain>

Krzysztof Halasa wrote:
> Richard Knutsson <ricknu-0@student.ltu.se> writes:
>
>   
>>> I guess we could use tabs only at the line start, for indentation
>>> only. Rather hard to implement, most text editors can't do that yet.
>>>   
>>>       
>> You mean for split lines?
>>     
>
> Syntactic indentation vs alignment (including comments after
> non-blank, values for struct initialization etc, split lines too).
>
>   
'alignment', that's the word, thanks!
>> Hopefully there won't be that many, so there
>> is just to delete the tabs it added and replace it with spaces.
>>     
>
> Actually tabs "should" be used for indentation at start of the
> line, then spaces. "Ideally" :-)
>
> I.e., something like
> <TAB>	if (cond && (cond2 ||
> <TAB>	_____________cond3))
> <TAB>	<TAB>	do_something();
>
> Underline = space.
>
> Perhaps some day...
>
>   
>> Exactly! But then we can remove the "we use 8 wide tabs in the kernel"
>> in CodeStyle.
>>     
>
> I'm not sure it's practically possible now.
>   
Well, can always patch CodeStyle and checkpatch.pl and then see what the 
rest thinks.

Think checkpatch is fairly easy to "fix". It seems to have all the lines 
in an array so there is only a need to check the indent-depth of the 
line above and see if the current is the same with only spaces afterwards.

The idea was to reply with a patch, but it is bit late now.
>   
>>> Unpacked sources will be much bigger with not tabs, sure.
>>>   
>>>       
>> Without no tabs at all, you mean?
>>     
>
> With spaces in place of all tabs.
>
> All tabs converted to spaces = 20% more?
> "Alignment" tabs converted to spaces? How cares how much more would it
> take if it's the correct thing. Except that it's not very practical at
> this point.
>   
Would guess more...
The reason I reacted were because checkpatch.pl complained about a:
<tab><tab>foo(int a,
<tab><tab>____int b)
with the "use tabs not spaces". There is little point in patching this 
stuff but lets not make it worse (IMHO).


      reply	other threads:[~2008-02-25 21:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-24  0:48 Richard Knutsson
2008-02-24 14:56 ` Krzysztof Halasa
2008-02-24 15:01   ` Miles Bader
2008-02-25 22:13     ` Richard Knutsson
2008-02-26  2:00       ` Jan Engelhardt
2008-02-26 15:50         ` Krzysztof Halasa
2008-02-26 22:03         ` Richard Knutsson
2008-02-24 15:40   ` Richard Knutsson
2008-02-24 16:15     ` Benny Halevy
2008-02-25 21:40       ` Richard Knutsson
2008-02-26  0:47         ` Benny Halevy
2008-02-24 17:36     ` Krzysztof Halasa
2008-02-25 21:56       ` Richard Knutsson [this message]

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=47C33982.8030902@student.ltu.se \
    --to=ricknu-0@student.ltu.se \
    --cc=khc@pm.waw.pl \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: Tabs, spaces, indent and 80 character lines' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).