From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11126 invoked from network); 25 Mar 2009 18:20:38 -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.4 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; 25 Mar 2009 18:20:38 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 14852 invoked from network); 25 Mar 2009 18:20:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Mar 2009 18:20:34 -0000 Received: (qmail 26876 invoked by alias); 25 Mar 2009 18:20:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26792 Received: (qmail 26858 invoked from network); 25 Mar 2009 18:20:28 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 25 Mar 2009 18:20:28 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [85.115.60.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 28DDC80590EB for ; Wed, 25 Mar 2009 19:20:25 +0100 (CET) Received: from rly06d.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly06d.srv.mailcontrol.com (MailControl) with ESMTP id n2PIKGNp008534 for ; Wed, 25 Mar 2009 18:20:21 GMT Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly06d.srv.mailcontrol.com (MailControl) id n2PIKCAT007870 for zsh-workers@sunsite.dk; Wed, 25 Mar 2009 18:20:12 GMT Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly06d-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id n2PIK8iw007506; Wed, 25 Mar 2009 18:20:12 +0000 (GMT) Received: from news01.csr.com ([10.99.50.25]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 25 Mar 2009 18:20:08 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id n2PIK7wj016482; Wed, 25 Mar 2009 18:20:08 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id n2PIK6JI016478; Wed, 25 Mar 2009 18:20:07 GMT Message-Id: <200903251820.n2PIK6JI016478@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk, 517008@bugs.debian.org Subject: Re: Bug#517008: alias not expanded with zsh -c In-reply-to: <090325111130.ZM7836@torch.brasslantern.com> References: <20090225022850.GA4841@vin.lip.ens-lyon.fr> <20090325145418.GB9330@scru.org> <200903251630.n2PGU8sK013449@news01.csr.com> <20090325172509.79c53d4d@news01> <090325111130.ZM7836@torch.brasslantern.com> Comments: In-reply-to Bart Schaefer message dated "Wed, 25 Mar 2009 11:11:28 -0700." Date: Wed, 25 Mar 2009 18:20:05 +0000 From: Peter Stephenson X-OriginalArrivalTime: 25 Mar 2009 18:20:08.0057 (UTC) FILETIME=[53CEAE90:01C9AD76] X-Scanned-By: MailControl A_08_51_00 (www.mailcontrol.com) on 10.68.1.116 X-Virus-Scanned: ClamAV 0.92.1/9165/Wed Mar 25 16:08:41 2009 on bifrost X-Virus-Status: Clean Bart Schaefer wrote: > } Is the fix as simple as the following? This is not a trick question, I > } could very easily have missed something. > > Will this cover "emulate -c"? If you mean cover it in the sense that the option is turned on before any code is parsed---yes, but that's not changed by this patch. It won't cover the case where emulate -c is followed by multiple lines of code that define aliases that are expected to be available in following lines. I'm not sure it needs to: there's no question of that being standardised and we are at liberty to define the rule as being what it is by default, i.e. code is parsed and aliases expanded before any code is executed; although I can see you might expect it to be the same as the shell's own -c option. > I'm a bit leery of even starting down this road, because it still fails > to make any difference if the alias definition and use are on the same > line (separated with ";" or "&&" etc.). I think it's accepted that this will not work with any current shell implementation, not just zsh. But yes, I share your feeling that this isn't a particularly vital addition, it just looked easy to do like other shells in compatability mode, which is the point of that. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070