From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14845 invoked from network); 6 Feb 2002 09:00:38 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 6 Feb 2002 09:00:38 -0000 Received: (qmail 22565 invoked by alias); 6 Feb 2002 09:00:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16573 Received: (qmail 22541 invoked from network); 6 Feb 2002 09:00:23 -0000 Message-ID: <20020206090019.81014.qmail@web9301.mail.yahoo.com> Date: Wed, 6 Feb 2002 09:00:19 +0000 (GMT) From: =?iso-8859-1?q?Oliver=20Kiddle?= Subject: Re: ssh completion problem To: zsh-workers@sunsite.dk In-Reply-To: <1020205170847.ZM29675@candle.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit [ moved to -workers ] Bart wrote: > when I complete after `lll@' I get offered all possible hosts from the > `hosts' style. I want to be offered only `bbb.com' in that case. > > (When I complete after just `l', it completes to `lll', then waits for > another tab.) > > The problem is somehow related to this additional style: > > tag-order my-accounts \ > 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *' I think the problem is due to this line in _combination: compadd "$@" -a tmp || { (( $+functions[_$key] )) && "_$key" "$@" } The line gets run for each of host hosts, domains and IP addresses. Only one needs to fail for "_$key" (_hosts in effect) to go on to run. This is quite possible as "$@" expands to, amoung other things, `-F _comp_ignore'. I think the patch below is the right fix - provided tmp can't be different with each of the tags. We do compadd || compadd in other parts of the completion system so they may also be afflicted. As I think I've mentioned previously, a way of specifying a default tag-order would be better. Oliver --- Completion/Base/Utility/_combination Mon Apr 2 12:10:08 2001 +++ Completion/Base/Utility/_combination Wed Feb 6 03:21:32 2002 @@ -88,7 +88,11 @@ fi tmp=( ${tmp%%${~sep}*} ) - compadd "$@" -a tmp || { (( $+functions[_$key] )) && "_$key" "$@" } + if (( $#tmp )); then + compadd "$@" -a tmp + elif (( $+functions[_$key] )); then + "_$key" "$@" + fi else (( $+functions[_$key] )) && "_$key" "$@" fi __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com