Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completions issues
- X-seq: zsh-users 5164
- From: GoTaR <gotar@xxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: completions issues
- Date: Sun, 14 Jul 2002 12:55:54 +0200
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <1020713212037.ZM8169@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020710204701.GA3362@os> <1026499603.2775.6.camel@xxxxxxxxxxxxxxxxxxxxx> <20020713193728.GA11214@os> <1020713212037.ZM8169@xxxxxxxxxxxxxxxxxxxxxxx>
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
'alias<tab><tab>number alias<tab><tab>number...'...
> 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 <gotar@xxxxxxxxxxxxx>
PLD stuff at http://mops.uci.agh.edu.pl/~gotar/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author