public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Lindent and coding style
@ 2006-03-20 11:32 Li Yang-r58472
  2006-03-20 14:36 ` Alan Cox
  0 siblings, 1 reply; 9+ messages in thread
From: Li Yang-r58472 @ 2006-03-20 11:32 UTC (permalink / raw)
  To: linux-kernel

There is a lindent script in linux kernel source.  It breaks long lines, but uses space instead of tab as indentation.  However, the codingstyle document also from the kernel source indicates no space is allowed for indentation.  Is there a fix for this problem?  Or the result from lindent(space indentation) is actually allowed in kernel source?  Thanks.

--
Leo Li
Freescale Semiconductor
 
LeoLi@freescale.com 


^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Lindent and coding style
@ 2006-03-21  2:55 Li Yang-r58472
  2006-03-21 10:22 ` Alan Cox
  0 siblings, 1 reply; 9+ messages in thread
From: Li Yang-r58472 @ 2006-03-21  2:55 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

> From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk]
> Sent: Monday, March 20, 2006 10:37 PM
> To: Li Yang-r58472
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: Lindent and coding style
> 
> On Llu, 2006-03-20 at 19:32 +0800, Li Yang-r58472 wrote:
> > There is a lindent script in linux kernel source.  It breaks long
> > lines, but uses space instead of tab as indentation.  However, the
> > codingstyle document also from the kernel source indicates no space is
> > allowed for indentation.  Is there a fix for this problem?  Or the
> > result from lindent(space indentation) is actually allowed in kernel
> > source?  Thanks.
> >
> 
> It should produce suitable output. Do you have examples of where it
> produces space indentation and you expect tabs ?
As Jiri has said, it produces code like
<tab>	if (very long condition &&
<tab>   ssss2nd condition)...
The indent command will align the second line at the next character of the left parentheses it belongs to.  In my opinion, this approach makes code more readable.  However, it does not comply with the coding style of kernel.

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Lindent and coding style
@ 2006-03-21  2:58 Li Yang-r58472
  0 siblings, 0 replies; 9+ messages in thread
From: Li Yang-r58472 @ 2006-03-21  2:58 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

> From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk]
> Sent: Monday, March 20, 2006 10:37 PM
> To: Li Yang-r58472
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: Lindent and coding style
> 
> On Llu, 2006-03-20 at 19:32 +0800, Li Yang-r58472 wrote:
> > There is a lindent script in linux kernel source.  It breaks long
> > lines, but uses space instead of tab as indentation.  However, the
> > codingstyle document also from the kernel source indicates no space is
> > allowed for indentation.  Is there a fix for this problem?  Or the
> > result from lindent(space indentation) is actually allowed in kernel
> > source?  Thanks.
> >
> 
> It should produce suitable output. Do you have examples of where it
> produces space indentation and you expect tabs ?
One more thing to add, my indent is GNU indent 2.2.9 coming with Redhat 9.0.  Does it matter?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-03-21 10:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-20 11:32 Lindent and coding style Li Yang-r58472
2006-03-20 14:36 ` Alan Cox
2006-03-20 14:51   ` Jiri Slaby
2006-03-20 16:12     ` Xavier Bestel
2006-03-20 16:21       ` Jiri Slaby
2006-03-20 16:28         ` Xavier Bestel
  -- strict thread matches above, loose matches on Subject: below --
2006-03-21  2:55 Li Yang-r58472
2006-03-21 10:22 ` Alan Cox
2006-03-21  2:58 Li Yang-r58472

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox