From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8364 invoked from network); 27 Sep 2004 09:04:06 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Sep 2004 09:04:06 -0000 Received: (qmail 47953 invoked from network); 27 Sep 2004 09:04:00 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Sep 2004 09:04:00 -0000 Received: (qmail 10945 invoked by alias); 27 Sep 2004 09:03:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20411 Received: (qmail 10930 invoked from network); 27 Sep 2004 09:03:45 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 27 Sep 2004 09:03:45 -0000 Received: (qmail 47297 invoked from network); 27 Sep 2004 09:02:46 -0000 Received: from mail36.messagelabs.com (193.109.254.211) by a.mx.sunsite.dk with SMTP; 27 Sep 2004 09:02:33 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-3.tower-36.messagelabs.com!1096275751!9620709 X-StarScan-Version: 5.2.10; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 8651 invoked from network); 27 Sep 2004 09:02:31 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-3.tower-36.messagelabs.com with SMTP; 27 Sep 2004 09:02:31 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i8R92VAI000300 for ; Mon, 27 Sep 2004 10:02:31 +0100 Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id 1F37E7990DF0 for ; Mon, 27 Sep 2004 11:02:11 +0200 (CEST) X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <20040925003815.GD26071@blorf.net> From: Oliver Kiddle References: <20040925003815.GD26071@blorf.net> To: zsh-workers@sunsite.dk Subject: Re: Completion for darcs Date: Mon, 27 Sep 2004 11:02:11 +0200 Message-ID: <17141.1096275731@trentino.logica.co.uk> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On 24 Sep, Wayne Davison wrote: > I've made some simple changes to the zsh-completion example that > ships with darcs (the version control system) and checked it into > the Completion/Unix/Command dir. It seems to work well in my > testing so far. I've attached the file to this email as well. This doesn't complete filenames at all. Is that always right for darcs? As the recent point on zsh-users about completion after "svn import" highlights, it is quite annoying when filename completion is broken. It very clearly looks like someone has converted this from a bash function. You can specify that a bash function should revert to filename completion if no matches are added with a "-o default" or "-o bashdefault" option to complete. That's outside the function and a bit hidden so we need to be careful about functions converted from bash. We also don't need to grep for $PREFIX: matching is done far better internally. Even in bash, that's not the right way to do it (use compgen -W and pass the prefix as a final argument). We also don't need the _darcs() { ... } stuff and the compadds should go through _wanted (the second perhaps through _arguments). Return statements are also wrong. Oliver