From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20400 invoked from network); 8 Feb 2002 18:26:20 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 8 Feb 2002 18:26:20 -0000 Received: (qmail 29140 invoked by alias); 8 Feb 2002 18:26:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16594 Received: (qmail 29126 invoked from network); 8 Feb 2002 18:26:08 -0000 Date: Fri, 8 Feb 2002 18:26:06 +0000 (GMT) From: Bart Schaefer Sender: lantern@brasslantern.com To: =?iso-8859-1?q?Oliver=20Kiddle?= cc: zsh-workers@sunsite.dk Subject: Re: ssh completion problem In-Reply-To: <20020208094052.89650.qmail@web9307.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 8 Feb 2002, [iso-8859-1] Oliver Kiddle wrote: > Suppose that an outer tag loop separately completes several labels for > a tag and that there is an inner tag loop for which there is a defined > tag-order. It can't then be known in the inner loop if matches are > added for a tag because it might be ignoring matches for a different > label which are added after it back-tracks to the outer tags loop and > then down to the inner loop with a new tag label. Without this > knowledge, the inner loop can't know whether to allow tags which appear > later in the tag-order to be completed. > > Using a tags loop in _combination runs in to problems with this. The > following patch appears to work: > > -local sep tag style keys pats key num tmp > +local sep tag style keys pats key num tmp expl i all ret=1 > > + _my_accounts() { > + _wanted hosts expl host compadd "$@" -a tmp > + } > > - compadd "$@" -a tmp || { (( $+functions[_$key] )) && "_$key" "$@" } > + _tags "$tag" "not-$tag" > + while _tags; do > + (( $+functions[_$key] )) && > + _requested "not-$tag" expl 'ignore' "_$key" "$@" && ret=0 > + _requested "$tag" expl '' _my_accounts "$@" && ret=0 > + (( ret )) || break > + done > > More by luck than judgement however as looking up the tag-order with > the my-accounts tag is clearing _comp_ignore. The little _my_accounts > function is then needed so that we get one last _next_label loop to > separate the hosts out again. I tried this patch, and it doesn't seem to help. That is, if I have a tag-order style, I get the same behavior as the old _combination: it completes the user part of the users-hosts from my-accounts, but then offers all possible hosts as completions for what comes after the @. Is there something else I should be doing, or was that patch not meant to solve my problem?