From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14209 invoked from network); 27 Feb 2007 20:36:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Feb 2007 20:36:02 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 37280 invoked from network); 27 Feb 2007 20:35:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Feb 2007 20:35:56 -0000 Received: (qmail 22619 invoked by alias); 27 Feb 2007 20:35:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23198 Received: (qmail 22609 invoked from network); 27 Feb 2007 20:35:52 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 27 Feb 2007 20:35:52 -0000 Received: (qmail 36898 invoked from network); 27 Feb 2007 20:35:52 -0000 Received: from mtaout02-winn.ispmail.ntl.com (81.103.221.48) by a.mx.sunsite.dk with SMTP; 27 Feb 2007 20:35:45 -0000 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com with ESMTP id <20070227203544.YLID3103.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Tue, 27 Feb 2007 20:35:44 +0000 Received: from pwslaptop.csr.com ([81.107.47.85]) by aamtaout01-winn.ispmail.ntl.com with SMTP id <20070227203544.CNSR219.aamtaout01-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Tue, 27 Feb 2007 20:35:44 +0000 Date: Tue, 27 Feb 2007 20:35:21 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: completion regex handling Message-Id: <20070227203521.15a9d9d7.p.w.stephenson@ntlworld.com> In-Reply-To: <070227084604.ZM13253@torch.brasslantern.com> References: <200702252237.l1PMb7Pw012255@pwslaptop.csr.com> <070226001857.ZM8988@torch.brasslantern.com> <20070227124105.8208c36c.pws@csr.com> <070227084604.ZM13253@torch.brasslantern.com> X-Mailer: Sylpheed version 2.2.10 (GTK+ 2.10.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 27 Feb 2007 08:46:04 -0800 Bart Schaefer wrote: > On Feb 27, 12:41pm, Peter Stephenson wrote: > } > } _values is doing something weird [traditional pause for amazed cries to die > } away] with the separator. It gets it with compvalues -s sep near the top, > } then further down there's this: > } > } if [[ ${#noargs}+${#args}+${#opts} -ne 1 ]] && compvalues -s sep; then > } sep=( "-qS" "$sep" ) > } else > } sep=() > } fi > > That all appears to date back to zsh-workers/8219 when Sven first added > the compvalues call. SourceForge CVS won't help because it doesn't go > back that far. Then look at workers/14257. Could Sven have missed a > spot where he needed to make a change? Also, perhaps some of those calls > to "compvalues -s sep" should (or at least could) be changed to instead > test (( $+sep )) or something? Unfortunately fn() { local sep; print $+sep; } fn prints 1. I can't see any good reason to ignore a separator that's been supplied. I'm going to commit the following and see what breaks. Playing with dd and parameter subscript completions suggests not a great deal, at least. I'm sure the quoting of the argument to _values is wrong in _regex_words is wrong in some way, and it's certainly inconsistent with the other branch. Index: Completion/Base/Utility/_regex_words =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_regex_words,v retrieving revision 1.1 diff -u -r1.1 _regex_words --- Completion/Base/Utility/_regex_words 25 Feb 2007 22:44:52 -0000 1.1 +++ Completion/Base/Utility/_regex_words 27 Feb 2007 20:32:30 -0000 @@ -31,9 +31,8 @@ if [[ $term = $'\0' ]]; then reply+=(":${tag}:${desc}:(( ${wds[1]//\*}:${wds[2]//(#m)[: \(\)]/\\$MATCH} ))") else - # HERE: we should add the terminator instead of a space, but - # there doesn't appear to be an easy way of doing that. - reply+=(":${tag}:${desc}:(( ${wds[1]//\*}${term//(#m)[: \(\)]/\\$MATCH}:${wds[2]//(#m)[: \(\)]/\\$MATCH} ))") + reply+=(":${tag}:${desc}:_values -s ${(q)term} ${(q)desc} \ +${(q)${${wds[1]//\*}//(#m)[:\[\]]/\\$MATCH}}\\[${(q)${wds[2]//(#m)[:\[\]]/\\$MATCH}}\\]") fi eval "reply+=($wds[3])" if (( $i == $# )); then Index: Completion/Base/Utility/_values =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_values,v retrieving revision 1.8 diff -u -r1.8 _values --- Completion/Base/Utility/_values 16 Apr 2002 07:55:49 -0000 1.8 +++ Completion/Base/Utility/_values 27 Feb 2007 20:32:30 -0000 @@ -50,7 +50,7 @@ fi else compvalues -d descr - if [[ ${#noargs}+${#args}+${#opts} -ne 1 ]] && compvalues -s sep; then + if compvalues -s sep; then sep=( "-qS" "$sep" ) else sep=() -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/