From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17607 invoked from network); 11 Aug 2006 11:11:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Aug 2006 11:11:50 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 22261 invoked from network); 11 Aug 2006 11:11:43 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Aug 2006 11:11:43 -0000 Received: (qmail 23843 invoked by alias); 11 Aug 2006 11:11:34 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10586 Received: (qmail 23833 invoked from network); 11 Aug 2006 11:11:33 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Aug 2006 11:11:33 -0000 Received: (qmail 21127 invoked from network); 11 Aug 2006 11:11:33 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 11 Aug 2006 11:11:31 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly24c.srv.mailcontrol.com (MailControl) with ESMTP id k7BBBHiN006745 for ; Fri, 11 Aug 2006 12:11:18 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Fri, 11 Aug 2006 12:10:57 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.4/8.13.4) with ESMTP id k7BBAu39017365 for ; Fri, 11 Aug 2006 12:10:56 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.4/8.13.4/Submit) with ESMTP id k7BBAuwM017362 for ; Fri, 11 Aug 2006 12:10:56 +0100 Message-Id: <200608111110.k7BBAuwM017362@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: "Zsh Users' List" Subject: Re: What would you say is the most-used way of indenting case labels In-reply-to: References: Comments: In-reply-to "Nikolai Weibull" message dated "Fri, 11 Aug 2006 12:54:29 +0200." Date: Fri, 11 Aug 2006 12:10:56 +0100 From: Peter Stephenson X-OriginalArrivalTime: 11 Aug 2006 11:10:57.0103 (UTC) FILETIME=[D1B82DF0:01C6BD36] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-04-01 (www.mailcontrol.com) on 10.67.0.134 "Nikolai Weibull" wrote: > That is, is this style: > > case something in > (*ome*) > ... ;; > esac > > more common than > > case something in > (*ome*) > ... ;; > esac I use Emacs sh-script mode and I end up with things looking like this case foo in (bar) do_foo_bar ;; (rod) do_foo_rod ;; esac which is pretty much your second option, except there's no additional indentation after the test and the separate ;; serves as a visual end marker (like a "break" in C). The zsh code seems to be full of things like: case foo in (bar) do_foo_bar ;; (rod) do_foo_rod ;; esac sometimes with a space between the ;; and the next test, sometimes without, sometimes with the ;; level with the test, sometimes indented as shown. However, there are other variations, too, including having the ";:" on the same line as the last chunk of code, which seems to be more common when there's only one line of executable code (which then sometimes appears on the line with the test). The only consensus seems to be the "(bar)" test is indented from the "case". -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php