From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17235 invoked from network); 13 Dec 2007 20:58:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) 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.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Dec 2007 20:58:24 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 63390 invoked from network); 13 Dec 2007 20:58:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Dec 2007 20:58:14 -0000 Received: (qmail 27570 invoked by alias); 13 Dec 2007 20:58:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24235 Received: (qmail 27515 invoked from network); 13 Dec 2007 20:58:10 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 13 Dec 2007 20:58:10 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id 89F1A8058F56 for ; Thu, 13 Dec 2007 21:55:25 +0100 (CET) Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Thu, 13 Dec 2007 21:55:25 +0100 (CET) Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com with ESMTP id <20071213205850.HJJO26125.mtaout03-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com>; Thu, 13 Dec 2007 20:58:50 +0000 Received: from pws-pc ([82.6.96.116]) by aamtaout04-winn.ispmail.ntl.com with SMTP id <20071213205807.VFDK29112.aamtaout04-winn.ispmail.ntl.com@pws-pc>; Thu, 13 Dec 2007 20:58:07 +0000 Date: Thu, 13 Dec 2007 20:56:22 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk, 377765@bugs.debian.org Subject: Re: Bug#377765: zsh: completion of configure script does not handle underscore properly Message-Id: <20071213205622.006d37a7.p.w.stephenson@ntlworld.com> In-Reply-To: <20071213190909.GA31400@scowler.net> References: <20060711070135.40826124047@star.phys.s.u-tokyo.ac.jp> <20061007095301.GA2210@scowler.net> <20071213190909.GA31400@scowler.net> X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 13 Dec 2007 14:09:09 -0500 Clint Adams wrote: > This still seems to be an issue and that patch no longer applies to > current _arguments. I would imagine something simple-minded like the following would do this consistently. Please commit it if it works. Index: Completion/Base/Utility/_arguments =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v retrieving revision 1.20 diff -u -r1.20 _arguments --- Completion/Base/Utility/_arguments 16 Feb 2007 15:02:03 -0000 1.20 +++ Completion/Base/Utility/_arguments 13 Dec 2007 20:56:36 -0000 @@ -97,7 +97,7 @@ # present. Maybe the problem was that the intervening code # didn't. If it's buggy without removing them, the problem # probably is later, not here. - if [[ -z ${tmp[(r)${match[1]%%[^a-zA-Z0-9-]#}]} ]]; then + if [[ -z ${tmp[(r)${match[1]%%[^a-zA-Z0-9_-]#}]} ]]; then tmp+=($match[1]) fi opt=$match[2] @@ -218,9 +218,9 @@ odescr= fi if [[ $opt = (#b)(*)\[\=* ]]; then - opt2=${${match[1]}//[^a-zA-Z0-9-]}=-${dir}${odescr} + opt2=${${match[1]}//[^a-zA-Z0-9_-]}=-${dir}${odescr} else - opt2=${${opt}//[^a-zA-Z0-9-]}=${dir}${odescr} + opt2=${${opt}//[^a-zA-Z0-9_-]}=${dir}${odescr} fi if [[ "$descr" = :\=* ]]; then cache+=( "${opt2}::${(L)${opt%\]}#*\=}: " ) @@ -247,7 +247,7 @@ else odescr= fi - opt2="${${opt%%\=*}//[^a-zA-Z0-9-]}=${dir}${odescr}" + opt2="${${opt%%\=*}//[^a-zA-Z0-9_-]}=${dir}${odescr}" if [[ "$descr" = :\=* ]]; then cache+=( "${opt2}:${(L)${opt%\]}#*\=}: " ) else @@ -268,7 +268,7 @@ # I discovered after about half an hour, so don't do that. "${(@)^${(@)tmp:#^*:*}//:/[}]" # commands with no description - "${(@)${(@)tmp:#*:*}//[^a-zA-Z0-9-]}") + "${(@)${(@)tmp:#*:*}//[^a-zA-Z0-9_-]}") if [[ -n "$descr" && "$descr" != ': : ' ]]; then cache+=( "${(@)^tmp}${descr}" ) else -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/