From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4706 invoked from network); 12 Feb 2002 09:19:05 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Feb 2002 09:19:05 -0000 Received: (qmail 15454 invoked by alias); 12 Feb 2002 09:18:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16605 Received: (qmail 15442 invoked from network); 12 Feb 2002 09:18:57 -0000 Message-ID: <20020212091854.12456.qmail@web9306.mail.yahoo.com> Date: Tue, 12 Feb 2002 09:18:54 +0000 (GMT) From: =?iso-8859-1?q?Oliver=20Kiddle?= Subject: Re: ssh completion problem To: zsh-workers@sunsite.dk In-Reply-To: <15463.35595.321048.104361@wischnow.berkom.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit --- Bart Schaefer wrote: > 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? Did you try the first patch? The second patch was there because it demonstrates why I think this problem is more fundamental than just _combination. If you just want to get this working, Sven's patch is now perhaps a better bet as I see you've now done. Needing two tabs is a separate issue which has come up before. A possible solution to that might be some value in compstate which if set causes completion to have another go if a first match was unambiguously added. It'll be more complicated if l@b is to complete to lll@bbb.com though. Sven Wischnowsky wrote: > > I can't reproduce that. > > You need to set some ignored-patterns styles to split into host, > host-with-domain and ip-address. I did have ignored-patterns styles set - '*.*' (host), '^[^0-9]*.*' (domain) and '^[0-9.]#' (ipaddr). Perhaps Bart's use of different patterns was significant though. > Your analysis is basically right, the problem is that _combination > doesn't know whether there might be other matches be added for the > tag > by an outer loop. So I think what is wrong here is _combination > adding > default matches. I'd think that's simlpy the wrong place to do that. Where is the right place to add default matches then? Having a way to specify a default tag-order would seem the most logical to me. > One way to circumvent most problems with tag and label loops is to > make _combination loop: With this there is then two loops for the hosts tag. The inner loop allows it to loop over the three labels again so it knows if matches are added for each label or not. Note that there are then nine calls to compadd. It only works because the final (innermost) label loop is for the same tag that is separated into labels. I still am convinced that there is a wider problem which this doesn't solve. The second patch in my last post is a useful one for seeing the problems. > > This is unrelated but out of interest, why is the _next_labels stage > > skipped in some completion functions? > > Could you give me an example, so that I don't need to search? _netscape. There's also a few cases which look like `_requested users && _users && ret=0' but I suppose they're okay because of _users calling _wanted? Oliver __________________________________________________ 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