From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10462 invoked from network); 31 Jan 2000 09:45:50 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 31 Jan 2000 09:45:50 -0000 Received: (qmail 59 invoked by alias); 31 Jan 2000 09:45:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9484 Received: (qmail 29908 invoked from network); 31 Jan 2000 09:45:22 -0000 Date: Mon, 31 Jan 2000 10:09:53 +0100 (MET) Message-Id: <200001310909.KAA28126@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Alexandre Duret-Lutz's message of 28 Jan 2000 17:24:14 +0100 Subject: Re: PATCH: _diff (new), _prcs (upgrade) Alexandre Duret-Lutz wrote: > ... > > Sven> I suggested that to enable completion functions to make it as you > Sven> described in 9453: if we are completing for the command, call it > Sven> without a `command', otherwise with it. And that can't be decided in > Sven> _call. > > I must be missing something. Can't $curcontext be used? > I am thinking about something like this: > > # > _call () { > if [[ $curcontext == *:$1: ]] > then > $1 #(A) > else > command $1 #(B) > fi > } > > _f() { > _call foo > } > > compdef _f foo bar > > > seems to run either (A) or (B) wheter I complete after foo or bar. Hm, for forcing the test to use only command names, this would be `::${1}:'. Maybe. I'm trying to think of a case where this would fail, but I can't find one just now... Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de