From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26643 invoked from network); 23 Jun 2009 20:27:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FAKE_REPLY_C autolearn=no version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 23 Jun 2009 20:27:31 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 79811 invoked from network); 23 Jun 2009 20:17:51 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Jun 2009 20:17:51 -0000 Received: (qmail 7867 invoked by alias); 23 Jun 2009 20:17:05 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14203 Received: (qmail 7852 invoked from network); 23 Jun 2009 20:17:04 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 23 Jun 2009 20:17:04 -0000 Received: from pepper.fruitcom.com (pepper.fruitcom.com [194.109.117.112]) by bifrost.dotsrc.org (Postfix) with ESMTP id D0C668027106 for ; Tue, 23 Jun 2009 22:17:01 +0200 (CEST) Received: by pepper.fruitcom.com (Postfix, from userid 1000) id A302029050A; Tue, 23 Jun 2009 22:17:01 +0200 (CEST) Date: Tue, 23 Jun 2009 22:17:01 +0200 From: Eric Smith To: zsh-users@sunsite.dk Subject: Re: invoking compadd so that completion is for the second argument Message-ID: <20090623201701.GO4907@trustfood.org> Mail-Followup-To: zsh-users@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Virus-Scanned: ClamAV 0.94.2/9498/Tue Jun 23 19:15:50 2009 on bifrost X-Virus-Status: Clean Thanks Bart Bart Schaefer said: > For example, given a command line such as: > > % roger dodger codger > > Do you mean: > > (1) The completion for "roger" is invoked, but the set of matches for > "codger" is not the same as the set of matches for "dodger"; or Something like this, indeed. I create commands that allow me to copy or move existing files to special named files. The prefix of these special names I want to look up from a list in a file referenced by compadd. So the command: % prefix_cp sour will just complete as per the default rules, but % prefix_cp source_file.pdf should give me: % prefix_cp source_file.pdf aa_code_reference_00034 assuming this was the first match in the list Oh I just had an idea for the first time now writing this. If I went: % prefix_cp source_file.pdf aa_code_reference_00034_ It would be great to have as the completion the first arg viz. !#1 or `source_file.pdf' But this is a bonus. Thanks a lot. Eric