From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8499 invoked from network); 11 Sep 2008 12:00:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Sep 2008 12:00:46 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 84352 invoked from network); 11 Sep 2008 12:00:39 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Sep 2008 12:00:39 -0000 Received: (qmail 25978 invoked by alias); 11 Sep 2008 12:00:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25641 Received: (qmail 25960 invoked from network); 11 Sep 2008 12:00:31 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 11 Sep 2008 12:00:31 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 7F5D1802710A for ; Thu, 11 Sep 2008 14:00:26 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly38d.srv.mailcontrol.com (MailControl) with ESMTP id m8BBxORi023661 for ; Thu, 11 Sep 2008 13:00:12 +0100 Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Thu, 11 Sep 2008 13:00:10 +0100 Date: Thu, 11 Sep 2008 13:00:05 +0100 From: Peter Stephenson To: "Zsh Hackers' List" Subject: Re: preventing the leading space in process substitution Message-ID: <20080911130005.7c5e2b7c@news01> In-Reply-To: <6cd6de210809101151q4d0a2a35p452fe656e0ee7dd5@mail.gmail.com> References: <20080909144101.GA30693@lapse.rw.madduck.net> <200809101124.m8ABOlKI005063@news01.csr.com> <080910074842.ZM19151@torch.brasslantern.com> <200809101510.m8AFAajX007203@news01.csr.com> <080910090554.ZM19272@torch.brasslantern.com> <6cd6de210809101151q4d0a2a35p452fe656e0ee7dd5@mail.gmail.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 Sep 2008 12:00:10.0937 (UTC) FILETIME=[F11CFA90:01C91405] X-Scanned-By: MailControl A-08-50-13 (www.mailcontrol.com) on 10.68.0.148 X-Virus-Scanned: ClamAV 0.92.1/8215/Thu Sep 11 12:04:05 2008 on bifrost X-Virus-Status: Clean On Wed, 10 Sep 2008 14:51:04 -0400 "Rocky Bernstein" wrote: > Also (mentioned previously), I think the multiple function definition with a > single body syntax should be removed when sh or bash emulation is in effect. > Those POSIX shell variants neither support this form and having it around > allows it to get confused causing a more obscure error message when one > writes "typeset -a foo=(list)" which is valid in those other POSIX shell > variants. (Moved to zsh-workers.) That's probably useful; it's been spotted before that multiple function definitions of this form can be pretty confusing to zsh users, too. Note, however, that the case you showed already gives a different error, since the parentheses aren't empty. In bash/ksh emulation you should get the reasonable "typeset: foo: can't assign initial value for array". Index: Doc/Zsh/options.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/options.yo,v retrieving revision 1.63 diff -u -r1.63 options.yo --- Doc/Zsh/options.yo 7 Aug 2008 16:27:15 -0000 1.63 +++ Doc/Zsh/options.yo 11 Sep 2008 11:43:08 -0000 @@ -1133,6 +1133,14 @@ will restore normally handling of tt(SIGINT) after the function exits. ) +pindex(MULTI_FUNC_DEF) +item(tt(MULTI_FUNC_DEF) )( +Allow definitions of multiple functions at once in the form `tt(fn1 +fn2)var(...)tt(LPAR()RPAR())'; if the option is not set, this causes +a parse error. Definition of multiple functions with the tt(function) +keyword is always allowed. Multiple function definitions are not often +used and can cause obscure errors. +) pindex(MULTIOS) item(tt(MULTIOS) )( Perform implicit bf(tee)s or bf(cat)s when multiple Index: Src/options.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/options.c,v retrieving revision 1.45 diff -u -r1.45 options.c --- Src/options.c 7 Aug 2008 16:27:15 -0000 1.45 +++ Src/options.c 11 Sep 2008 11:43:08 -0000 @@ -181,6 +181,7 @@ 0 #endif }, MULTIBYTE}, +{{NULL, "multifuncdef", OPT_EMULATE|OPT_ZSH}, MULTIFUNCDEF}, {{NULL, "multios", OPT_EMULATE|OPT_ZSH}, MULTIOS}, {{NULL, "nomatch", OPT_EMULATE|OPT_NONBOURNE},NOMATCH}, {{NULL, "notify", OPT_ZSH}, NOTIFY}, Index: Src/parse.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/parse.c,v retrieving revision 1.73 diff -u -r1.73 parse.c --- Src/parse.c 1 Sep 2008 20:18:48 -0000 1.73 +++ Src/parse.c 11 Sep 2008 11:43:08 -0000 @@ -1663,6 +1663,9 @@ zlong oldlineno = lineno; int onp, so, oecssub = ecssub; + if (!isset(MULTIFUNCDEF) && argc > 1) + YYERROR(oecused); + *complex = c; lineno = 0; incmdpos = 1; Index: Src/zsh.h =================================================================== RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v retrieving revision 1.145 diff -u -r1.145 zsh.h --- Src/zsh.h 3 Sep 2008 09:08:22 -0000 1.145 +++ Src/zsh.h 11 Sep 2008 11:43:08 -0000 @@ -1882,6 +1882,7 @@ MENUCOMPLETE, MONITOR, MULTIBYTE, + MULTIFUNCDEF, MULTIOS, NOMATCH, NOTIFY, -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070