From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10834 invoked from network); 28 Jan 2000 15:04:04 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Jan 2000 15:04:04 -0000 Received: (qmail 13313 invoked by alias); 28 Jan 2000 15:03:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9459 Received: (qmail 13305 invoked from network); 28 Jan 2000 15:03:52 -0000 To: zsh-workers@math.gatech.edu Cc: Sven Wischnowsky Subject: Re: PATCH: _diff (new), _prcs (upgrade) References: <200001281025.LAA20330@beta.informatik.hu-berlin.de> X-Attribution: adl From: Alexandre Duret-Lutz Date: 28 Jan 2000 16:04:23 +0100 In-Reply-To: Sven Wischnowsky's message of "Fri, 28 Jan 2000 11:25:22 +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: [...] >> My opinion is: we should write $(XXX) if we are in the completion >> function for XXX, and $(command XXX) otherwise. [...] Sven> But then a hackishly written function may still break everything (if Sven> you have a function for diff that actually does something if invoked Sven> with zero or only one argument, for example). Yes. And since _call shall allow people to customize the completion system for those cases, it's not a problem anyway. [...] Sven> So the style would only be used to get the command (including: how it Sven> should be invoked, i.e. with `command' or not) and any options the Sven> user wants to give to it. If the style is not set we use some standard Sven> way, so we don't have to set up default styles for this. This (your last sentence) assume that no option is used by default (like the call to ps in _pids). This seems restrictive (but I don't have an example where options are needed by default, and where the user would want to change them). >> ... >> >> Another point about the $+functions[] test: what if I am writting a >> completion function for a shell function? say I need to call it, how do I >> do? Sven> Good point. Also testing $+commands and $+builtins might help here, Sven> but could still be wrong. Hm, I just wanted to make this cleverer but Sven> since the style would allow one to override it anyway, we should Sven> probably just call it without any pre-command modifier in the default Sven> case. Or let _call accept options like -c and -b to say that the Sven> default should use `command' or `builtin'. Given I am writting a _call in a completion function, how do I decide whether I must use -[bc] or not? We ne a rule here, that should be used consistently in the completion system (see the first paragraph for what I suggest). And if a rule is chosen, _call can apply it, and therefore -[bc] parameters may not be needed anymore. [...] -- Alexandre Duret-Lutz