From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11548 invoked from network); 28 Jan 2000 16:24:15 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Jan 2000 16:24:15 -0000 Received: (qmail 25891 invoked by alias); 28 Jan 2000 16:24:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9461 Received: (qmail 25881 invoked from network); 28 Jan 2000 16:24:07 -0000 To: zsh-workers@math.gatech.edu Cc: Sven Wischnowsky Subject: Re: PATCH: _diff (new), _prcs (upgrade) References: <200001281511.QAA26310@beta.informatik.hu-berlin.de> X-Attribution: adl From: Alexandre Duret-Lutz Date: 28 Jan 2000 17:24:14 +0100 In-Reply-To: Sven Wischnowsky's message of "Fri, 28 Jan 2000 16:11:19 +0100 (MET)" Message-ID: User-Agent: Gnus/5.070096 (Pterodactyl Gnus v0.96) Emacs/20.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >>> "Sven" == Sven Wischnowsky writes: Sven> Alexandre Duret-Lutz wrote: [...] Sven> The only problem is that this means that such options will always be Sven> combined with the ones a user might define in a style. I.e. there are Sven> actually two types of options a completion function might give to a Sven> command: those that *have* to be there to make it work in the way the Sven> function needs it (like the -v for diff) and those the completion Sven> functions *suggests* to use -- which may be overridden by a user's Sven> style. Ideally, we should support both cases... Yes, I was speaking of what you call *suggested* options. As for now, to set these options, we should set a default style in compinit or elsewhere. But since these *suggested* options must be quite uncommon, this is not a problem. ok. [...] >> and if a rule is chosen, _call can apply it [...] 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. -- Alexandre Duret-Lutz