From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4783 invoked from network); 14 Jul 2002 20:25:13 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Jul 2002 20:25:13 -0000 Received: (qmail 15857 invoked by alias); 14 Jul 2002 20:24:47 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5164 Received: (qmail 15840 invoked from network); 14 Jul 2002 20:24:47 -0000 Date: Sun, 14 Jul 2002 12:55:54 +0200 From: GoTaR To: Bart Schaefer Cc: zsh-users@sunsite.dk Subject: Re: completions issues Message-ID: <20020714105554.GC824@os> References: <20020710204701.GA3362@os> <1026499603.2775.6.camel@localhost.localdomain> <20020713193728.GA11214@os> <1020713212037.ZM8169@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <1020713212037.ZM8169@candle.brasslantern.com> User-Agent: Mutt/1.4i On Sat, Jul 13, 2002 at 21:20:37 +0000, Bart Schaefer wrote: > } And question: how to make it without perl? > > smsas=( ${(f)$(smsaddr -l)} ) Here is the first trap - ${(f)... will change double tab to space, so smsas would contain 'alias number alias number...' instead of 'aliasnumber aliasnumber...'... > smsas=( ${smsas/ /:} ...and this won't work. > ${smsas/(#s)(#b)(*) (*)(#e)/$match[2]:$match[1]} ) > smsas=( ${(M)smsas:#$PREFIX*} ) > > I don't think you even need that last smsas= that matches against $PREFIX, > as the completion internals should take care of filtering the possible > matches generated by _sms_aliases against the actual input on the line. Completion filters possibilities by matchers, not their descriptions. In my case matcher and description must be dynamically chosen on the strength of prefix. As in other post: gotar:~: smsaddr -l [tab] SMS alias 6bone -- 509xxx admol -- 602xxx here admol is to be completed, 602xxx is description, but in: gotar:~: smsaddr -l 6[tab] SMS alias 6bone -- 509xxx 602xxx -- admol 602xxx is to be completed (prefix '6') and admol is it's description. -- GoTaR PLD stuff at http://mops.uci.agh.edu.pl/~gotar/