From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17283 invoked from network); 28 Jun 2009 19:54:59 -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=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham 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; 28 Jun 2009 19:54:59 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 4975 invoked from network); 28 Jun 2009 19:54:51 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Jun 2009 19:54:51 -0000 Received: (qmail 14022 invoked by alias); 28 Jun 2009 19:54:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27070 Received: (qmail 13998 invoked from network); 28 Jun 2009 19:54:44 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 28 Jun 2009 19:54:44 -0000 Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bifrost.dotsrc.org (Postfix) with ESMTP id BBF858027106 for ; Sun, 28 Jun 2009 21:54:32 +0200 (CEST) Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090628195432.GVSW6611.mtaout02-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com> for ; Sun, 28 Jun 2009 20:54:32 +0100 Received: from pws-pc ([81.107.42.185]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090628195432.HFRQ22934.aamtaout04-winn.ispmail.ntl.com@pws-pc> for ; Sun, 28 Jun 2009 20:54:32 +0100 Date: Sun, 28 Jun 2009 20:54:28 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: need help debugging cvs completion problem Message-ID: <20090628205428.77cd5198@pws-pc> In-Reply-To: References: <19013.18790.978774.551126@gargle.gargle.HOWL> <20090627212418.36848701@pws-pc> <20090628113802.GA3707@primenet.com.au> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.2; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=3l2oO9VmBWUA:10 a=0QhtZkFNAAAA:8 a=NLZqzBF-AAAA:8 a=JMKNGRb9fRo6rxPKYdAA:9 a=oS1W6rVPxgwbwjIxPtYZOf8SFzQA:4 a=KLYB3oV4TgcA:10 a=_dQi-Dcv4p4A:10 X-Virus-Scanned: ClamAV 0.94.2/9516/Sun Jun 28 20:08:45 2009 on bifrost X-Virus-Status: Clean On Sun, 28 Jun 2009 14:52:55 -0400 Greg Klanderman wrote: > this seems to work: > > _cvs_existing_entries() { > local expl match linedir realdir files disp > match=() > : ${PREFIX:#(#b)(*/)(*)} > linedir="$match[1]" > realdir=${(e)~linedir} > [[ -f "$realdir"CVS/Entries ]] && > disp=(${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}%%/*}) > files=( ${linedir}${(@)^disp} ) > (( ${#disp} )) && _wanted files expl file compadd -d disp -a files > } > > except it now breaks when 'linedir' contains a parameter substitution, > presumably the whole reason for the 'realdir' logic above, because the > '$' in the parameter substitution gets escaped with '\'. But > presumably adding '-Q' to compadd would break completing files that > contain characters that need to be escaped. Should I do that, and > escape characters that need it in $files? That sounds plausible---I think you're on the right lines. You might need a -U argument to compadd in that case, too. Basically, you are (anybody is) on your (their) own in this type of thing---lots of us have been somewhere similar once or twice and it was so complicated we've forgotten and won't remember again without devoting hours to remembering why we thought it was better to forget in the first place. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/