From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25305 invoked from network); 10 Oct 1998 13:13:49 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 10 Oct 1998 13:13:49 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id JAA04942; Sat, 10 Oct 1998 09:03:38 -0400 (EDT) Resent-Date: Sat, 10 Oct 1998 09:03:17 -0400 (EDT) Message-Id: <9810101253.AA14713@ibmth.df.unipi.it> To: gossamer@tertius.net.au, zsh-users@math.gatech.edu Subject: Re: ytalk completion In-Reply-To: "Bek Oberin"'s message of "10 Oct 1998 11:33:43 NFT." Date: Sat, 10 Oct 1998 14:53:29 +0200 From: Peter Stephenson Resent-Message-ID: <"tzWTP1.0.aC1.Lir7s"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1857 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bek Oberin wrote: > > Okay, I've figured out completion on ssh/telnet/etc. by means > of an array of my favorite hosts. But how can I do > the same for ytalk? > > ie I type > ytalk matt@ne > > and it completes the after-the-@-sign bit from the hosts array? The incantation is compctl -s '`users`' -x 'n[1,@]' -k hosts -- ytalk or something such (whatever array name you've used for the hosts). This is the canonical use for the 'n[...]' completion, so here's a patch adding this example to the manual page. (You need yodl for this to get through to the installable manual page.) Hope this doesn't clash with other manual patches this time. *** Doc/Zsh/compctl.yo.next Sun Jan 11 00:28:51 1998 --- Doc/Zsh/compctl.yo Sat Oct 10 14:48:05 1998 *************** *** 474,480 **** including the var(index)th occurrence of this string will not be considered part of the completion, but the rest will. var(index) may be negative to count from the end: in most cases, var(index) will be ! 1 or -1. ) item(tt(N[)var(index)tt(,)var(string)tt(])...)( Like tt(n) except that the string will be --- 474,487 ---- including the var(index)th occurrence of this string will not be considered part of the completion, but the rest will. var(index) may be negative to count from the end: in most cases, var(index) will be ! 1 or -1. For example, ! ! nofill(tt(compctl -s '`users`' -x 'n[1,@]' -k hosts -- talk)) ! ! will usually complete usernames, but if you insert an tt(@) after the ! name, names from the array var(hosts) (assumed to contain hostnames, ! though you must make the array yourself) will be completed. Other ! commands such as tt(rcp) can be handled similarly. ) item(tt(N[)var(index)tt(,)var(string)tt(])...)( Like tt(n) except that the string will be -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy