From owner-freebsd-chat@FreeBSD.ORG Wed Apr 15 07:40:18 2009 Return-Path: Delivered-To: freebsd-chat@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CFF710657F3 for ; Wed, 15 Apr 2009 07:40:18 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id E92EA8FC1A for ; Wed, 15 Apr 2009 07:40:07 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id AD835EB58C2; Wed, 15 Apr 2009 10:20:09 +0300 (EEST) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 7088B4509B; Wed, 15 Apr 2009 10:20:09 +0300 (EEST) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iUXjlsrpGrng; Wed, 15 Apr 2009 10:20:09 +0300 (EEST) Received: from kobe.laptop (adsl167-129.kln.forthnet.gr [62.1.146.129]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 3D6E445088; Wed, 15 Apr 2009 10:20:09 +0300 (EEST) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n3F7K81x027741; Wed, 15 Apr 2009 10:20:08 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n3F7K8b1027740; Wed, 15 Apr 2009 10:20:08 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: deeptech71@gmail.com References: <49E2FBE2.8020305@gmail.com> <20090413140912.GC29833@Grumpy.DynDNS.org> <49E51B42.2060405@gmail.com> <320BA0A7-C5E0-40E5-97F9-F19BF1C61B29@hiwaay.net> <49E5670C.8070708@gmail.com> Date: Wed, 15 Apr 2009 10:20:08 +0300 In-Reply-To: <49E5670C.8070708@gmail.com> (deeptech's message of "Wed, 15 Apr 2009 06:48:12 +0200") Message-ID: <87bpqytmc7.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-chat@freebsd.org Subject: Re: My whitespace style X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2009 07:40:20 -0000 On Wed, 15 Apr 2009 06:48:12 +0200, deeptech71@gmail.com wrote: > Could you please give me a (preferrably widely used) example of > columnizing calls which cross different levels of indentation? It's not so uncommon as it may initially seem... I've seen switch() cases in several programs indented like this: switch (value) { case SOME_CONSTANT_NAME: do_stuff_here(); break; case ANOTHER_CONSTANT_NAME: do_some_other_stuff(); break; default: default_stuff(); break; } I find this style horrible to read, but it does come with its own variation of TAB- and space-related issues and it is apparently attractive to a lot of people. Composite structure initializations also use a style similar to this, and will almost invariably end up looking horrendously misformatted when TAB sizes are 'elastic', i.e.: struct foo { long magic; const char *name; struct { int curr; int next; } nested; }; const struct foo statetab[] = { { 1, "one", { 1, 2}, }, { 1, "one", { 2, 2}, }, { 1, "one", { 3, 1}, }, { 1, "one", {65535, 1}, }, { 2, "two", { 1, 1}, }, { 2, "two", { 2, 2}, }, { 2, "two", { 3, 65535}, }, { 2, "two", {65535, 1}, }, ... { 65535, "invalid", { 1, 1}, }, { 65535, "invalid", { 2, 1}, }, { 65535, "invalid", { 3, 1}, }, { 65535, "invalid", {65535, 1}, }, }; This sort of alignment tends to generate *lots* of diff output when the alignment of a column changes, but it is often used for state transition tables of automata, and similar constructs.