From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25524 invoked from network); 20 Feb 2001 18:54:21 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 20 Feb 2001 18:54:21 -0000 Received: (qmail 28159 invoked by alias); 20 Feb 2001 18:54:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13510 Received: (qmail 28148 invoked from network); 20 Feb 2001 18:54:17 -0000 Date: Tue, 20 Feb 2001 18:54:16 +0000 From: Oliver Kiddle To: zsh-workers@sunsite.dk Subject: Re: Expanding interactively aliases Message-ID: <20010220185416.A448@rambo.logica.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: Oliver Kiddle Peter Stephenson wrote (on zsh-users): > Quite possibly Sven has already added an option to the _expand > completer by now, otherwise I'll try and remember to look at that. I had a quick look at _expand and, as I thought there is nothing to explicitly expand aliases. I thought about adding it myself and had in mind something along the lines of: if zstyle -T ":completion:${curcontext}:" aliases; then (( CURRENT == 1 )) || exp=( "$exp[@]" "$aliases[$words[1]]" ) exp=( "$exp[@]" "$galiases[$words[CURRENT]]" ) fi This is fairly irrelevant and don't expect that to work because I've not really tried it. My real point is that the existing _expand appears to be expanding global aliases already. I wouldn't have expected this because -U is used when autoloading _expand. A quick check reveals that this is with the substitute style and is due to the fact that the aliases are expanded within eval. I don't think it is ideal that autoload -U functions are subject to aliases within eval and you could probably break a few bits of completion with certain global aliases. Would it be easy to avoid this somehow? The other solution would be a -U argument to eval which probably isn't a great idea because eval currently takes no options. And, BTW, alias has a -L option which you could have used in your edit-alias function. Especially handy if you alias' name starts with '-'. Oliver Kiddle