From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16195 invoked from network); 20 Jul 2009 08:37:48 -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 new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 20 Jul 2009 08:37:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 98670 invoked from network); 20 Jul 2009 08:37:39 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Jul 2009 08:37:39 -0000 Received: (qmail 20832 invoked by alias); 20 Jul 2009 08:37:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27176 Received: (qmail 20797 invoked from network); 20 Jul 2009 08:37:27 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 20 Jul 2009 08:37:27 -0000 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bifrost.dotsrc.org (Postfix) with ESMTP id 333D38027106 for ; Mon, 20 Jul 2009 10:37:20 +0200 (CEST) Received: by ey-out-2122.google.com with SMTP id 9so474454eyd.3 for ; Mon, 20 Jul 2009 01:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3EPRQlFqbv7uTVFOiFwttFq+oMI2M/wo+UieJBRBOM8=; b=Qi6OhAaTjXOXsdVd8dbYkVTPhPZk6UzVsuW6yP5A3KwYCsbq8YUP+5ZA9zamKzr1ab +zn0BV9Ohvh7W6+pvCG+hySmEzLTEvmcQ9NMs1oNbKsN8kbvMa//7dgJiACD6+/hXXqO otuObRBrj3NGIKvmzZjGOkgJAT23YhJQyl4mU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Zf9cGcQwcmYFlMvPexKd43nMQQpfSAdohhr1Utzd+k4vwI9JLI4EZGb4SX+s1bP2sW yMbD6zMgq+b+x0UoCzdYY2bLyzzSOF0kYU1MNp2jejgKEp5+19gJCngfwRBFedmak/sB PjcMBcoeqOjItl3jNXHkIGU62RsTXKSLiy2mc= MIME-Version: 1.0 Received: by 10.210.89.7 with SMTP id m7mr4877364ebb.92.1248079040453; Mon, 20 Jul 2009 01:37:20 -0700 (PDT) In-Reply-To: <20090720092757.77e812c7@news01> References: <20090719171651.GA7217@piper.oerlikon.madduck.net> <20090719232041.GA5156@scru.org> <20090720092757.77e812c7@news01> Date: Mon, 20 Jul 2009 10:37:20 +0200 Message-ID: <237967ef0907200137j245d1bgc43303d2b9805249@mail.gmail.com> Subject: Re: Bug#537596: regression: parse error near `()' in function definition From: Mikael Magnusson To: zsh-workers@sunsite.dk Cc: martin f krafft , 537596@bugs.debian.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.94.2/9589/Sun Jul 19 05:14:56 2009 on bifrost X-Virus-Status: Clean 2009/7/20 Peter Stephenson : > On Sun, 19 Jul 2009 23:20:41 +0000 > Clint Adams wrote: >> On Sun, Jul 19, 2009 at 07:16:51PM +0200, martin f krafft wrote: >> > % eval 'lt() { (_lt-en $*; _en-lt $*) | more }' >> > zsh: parse error near `()' >> > >> > Alright, so lt is special: >> > >> > % which lt >> > lt: aliased to ls -lt > > Assuming lt was defined as an alias first, this has always been the wrong > thing to do: > > % alias lt="one two" > % eval 'lt() { (_lt-en $*; _en-lt $*) | more }' > % which one two > one () { > ( > _lt-en $* > _en-lt $* > ) | more > } > two () { > ( > _lt-en $* > _en-lt $* > ) | more > } > > This is not a new feature; it's been mentioned in the FAQ for many years. Just thought I'd mention you can also use \ at any time to escape an alias: % alias lt="one two" % eval '\lt() { echo foo }' % which lt lt: aliased to one two % unalias lt % which lt lt () { echo foo } % alias lt="one two" % which lt lt: aliased to one two % lt zsh: command not found: one % \lt foo % l\t foo -- Mikael Magnusson