From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11482 invoked from network); 19 Jun 2000 14:02:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Jun 2000 14:02:54 -0000 Received: (qmail 2099 invoked by alias); 19 Jun 2000 14:02:07 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3190 Received: (qmail 2077 invoked from network); 19 Jun 2000 14:01:22 -0000 Date: Mon, 19 Jun 2000 16:00:56 +0200 (MET DST) Message-Id: <200006191400.QAA32065@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-users@sunsite.auc.dk In-reply-to: Bernd Eggink's message of Sun, 18 Jun 2000 22:33:19 +0200 Subject: Re: Completion for variable assigement Bernd Eggink wrote: > I'd like to have completion for assignements to a variable. So that, > for example, > > PROJECT= > > will allow me to cycle through all file names in the current directory > ending with '.mak' (without the suffix). I succeeded in doing this only > by wrapping the assignement in a function 'setp': > > function projects > { > reply=(*.mak) 2>/dev/null > reply=(${reply%.mak}) > } > > function setp > { > PROJECT=$1 > } > > compctl -K projects setp > > Is there any way to avoid the wrapper function? Uh, if I remember correctly, completion in assignments is hard-wired for compctl. Use the new completion system and: _value:PROJECT() { _files -g '*.mak(:r)' -S ' ' } or, if it accepts colon-separated lists of such files: _value:PROJECT() { compset -P '*:'; _files -g '*.mak(:r)' -qS: } Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de