Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#537596: regression: parse error near `()' in function definition
- X-seq: zsh-workers 27176
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Bug#537596: regression: parse error near `()' in function definition
- Date: Mon, 20 Jul 2009 10:37:20 +0200
- Cc: martin f krafft <madduck@xxxxxxxxxx>, 537596@xxxxxxxxxxxxxxx
- 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=
- In-reply-to: <20090720092757.77e812c7@news01>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20090719171651.GA7217@xxxxxxxxxxxxxxxxxxxxxxxxxx> <20090719232041.GA5156@xxxxxxxx> <20090720092757.77e812c7@news01>
2009/7/20 Peter Stephenson <pws@xxxxxxx>:
> On Sun, 19 Jul 2009 23:20:41 +0000
> Clint Adams <schizo@xxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author