mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dimitrios Apostolou <jimis@gmx.net>
To: "Ted Ts'o" <tytso@mit.edu>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
	Krzysztof Halasa <khc@pm.waw.pl>,
	linux-kernel@vger.kernel.org, Dan Nicolaescu <dann@gnu.org>
Subject: Re: emacs and "linux" coding style
Date: Sun, 18 Jul 2010 12:10:09 +0300 (EEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1007181149560.3666@localhost.localdomain> (raw)
In-Reply-To: <20100718071552.GB4684@thunk.org>

On Sun, 18 Jul 2010, Ted Ts'o wrote:
> On Sat, Jul 17, 2010 at 06:51:46AM -0700, Randy Dunlap wrote:
>> On Sat, 17 Jul 2010 11:21:03 +0200 Krzysztof Halasa wrote:
>>
>>> Dimitrios Apostolou <jimis@gmx.net> writes:
>>>
>>>> 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)
>>>> {
>>>
>>> From a technical POV the above should not have any tabs, the parameters
>>> should be aligned with spaces only.
>>
>> fwiw, it seems that you agree with Ted.
>
> Actually, what my code use is tabs with a tab stop of 8 followed by
> enough spaces (< 7) to align function parameters and to align
> open/close parenthesis in C expression line wrap.

FWIW that way will show the parameters unaligned to anyone using a 
different tab length. There is one way to align such lines properly:

You indent with as many tabs as the previous line has and you use all 
spaces (perhaps more than 8) afterwards, to align parameters where you 
want them. In the example above that would use 0 tabs, all spaces...

Unfortunately this style is not the default to any editor I have seen, 
even though it really makes code readable with any tab length. Even for 
emacs you have to customize your config file:
http://www.emacswiki.org/emacs/SmartTabs


Dimitris


  parent reply	other threads:[~2010-07-18  9:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13 14:00 Dimitrios Apostolou
2010-07-13 22:19 ` Randy Dunlap
2010-07-14  6:12   ` Theodore Tso
2010-07-15 11:46     ` Dimitrios Apostolou
2010-07-17  9:21 ` Krzysztof Halasa
2010-07-17 13:51   ` Randy Dunlap
2010-07-17 23:18     ` Krzysztof Halasa
2010-07-18  7:15     ` Ted Ts'o
2010-07-18  9:05       ` Krzysztof Halasa
2010-07-18  9:10       ` Dimitrios Apostolou [this message]
2010-07-18  9:21         ` Ted Ts'o
2010-07-18 21:53           ` Krzysztof Halasa
2010-07-18  9:37       ` Artem Bityutskiy

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=alpine.LNX.2.00.1007181149560.3666@localhost.localdomain \
    --to=jimis@gmx.net \
    --cc=dann@gnu.org \
    --cc=khc@pm.waw.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=tytso@mit.edu \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®