From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29378 invoked from network); 14 Oct 2008 04:37:48 -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.1 required=5.0 tests=AWL autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 Oct 2008 04:37:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 21985 invoked from network); 14 Oct 2008 04:37:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Oct 2008 04:37:44 -0000 Received: (qmail 27003 invoked by alias); 14 Oct 2008 04:37:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25887 Received: (qmail 26992 invoked from network); 14 Oct 2008 04:37:38 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 14 Oct 2008 04:37:38 -0000 Received: from vms172069pub.verizon.net (vms172069pub.verizon.net [206.46.172.69]) by bifrost.dotsrc.org (Postfix) with ESMTP id B606280524C0 for ; Tue, 14 Oct 2008 06:37:23 +0200 (CEST) Received: from torch.brasslantern.com ([96.238.220.215]) by vms172069.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K8P00FKAOU9QB46@vms172069.mailsrvcs.net> for zsh-workers@sunsite.dk; Mon, 13 Oct 2008 23:37:23 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m9E4bL8D030877 for ; Mon, 13 Oct 2008 21:37:21 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m9E4bKeZ030876 for zsh-workers@sunsite.dk; Mon, 13 Oct 2008 21:37:20 -0700 Date: Mon, 13 Oct 2008 21:37:20 -0700 From: Bart Schaefer Subject: PATCH (?) Re: Regression in braces completion In-reply-to: <200810131627.m9DGRoED017498@news01.csr.com> To: "Zsh Hackers' List" Message-id: <081013213720.ZM30875@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20a807210810111932r1b32b746l3cca788a383e84ed@mail.gmail.com> <081011213249.ZM29979@torch.brasslantern.com> <081012001051.ZM30706@torch.brasslantern.com> <20081012204236.6669a668@pws-pc> <081012154721.ZM22722@torch.brasslantern.com> <20081013100417.36870ba5@news01> <081013084328.ZM28630@torch.brasslantern.com> <200810131627.m9DGRoED017498@news01.csr.com> Comments: In reply to Peter Stephenson "Re: Regression in braces completion" (Oct 13, 5:27pm) X-Virus-Scanned: ClamAV 0.92.1/8419/Tue Oct 14 04:08:23 2008 on bifrost X-Virus-Status: Clean On Oct 13, 5:27pm, Peter Stephenson wrote: } } > I wasn't suggesting treating this as a special case, I was suggesting } > that _path_files treat a spelling correction in the path prefix as a } > special case. That's the stated reason why _path_files is using -U. } } As you previously noted, there are already far too many ways of running } compadd within _path_files as it is. I'm not at all happy about } doubling the number to get sets with and without -U --- which would } leave spelling correction broken in the case where braces are present Somebody tell me what's wrong with this. Doesn't seem to break spelling correction in the path prefix when braces are present, and doesn't seem to break braces when spelling correction isn't present, and doesn't add any new calls to compadd; just changes whether the ones that are there get -U passed in. What am I missing? --- ../zsh-forge/current/Completion/Unix/Type/_path_files 2008-09-02 20:09:04.000000000 -0700 +++ Completion/Unix/Type/_path_files 2008-10-13 21:31:53.000000000 -0700 @@ -7,7 +7,7 @@ local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre local pats haspats ignore pfx pfxsfx sopt gopt opt sdirs ignpar cfopt listsfx local nm=$compstate[nmatches] menu matcher mopts sort mid accex fake -local listfiles listopts tmpdisp origtmp1 +local listfiles listopts tmpdisp origtmp1 Uopt integer npathcheck local -a match mbegin mend @@ -209,7 +209,7 @@ [[ $compstate[insert] = (*menu|[0-9]*) || -n "$_comp_correct" || ( -n "$compstate[pattern_match]" && "${orig#\~}" != (|*[^\\])[][*?#~^\|\<\>]* ) ]] && menu=yes -[[ -n "$_comp_correct" ]] && cfopt=- +[[ -n "$_comp_correct" ]] && cfopt=- Uopt=-U # Now let's have a closer look at the string to complete. @@ -612,7 +612,7 @@ # back up the path. tmp1=("${(@)tmp1%%/*}") _list_files tmp1 "$prepath$realpath$testpath" - compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \ + compadd $Uopt -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \ -s "/${tmp3#*/}$ISUFFIX" \ -W "$prepath$realpath$testpath" \ "$pfxsfx[@]" \ @@ -622,7 +622,7 @@ # Same with a non-empty suffix tmp1=("${(@)^tmp1%%/*}/${tmp3#*/}") _list_files tmp1 "$prepath$realpath$testpath" - compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \ + compadd $Uopt -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \ -s "$ISUFFIX" \ -W "$prepath$realpath$testpath" \ "$pfxsfx[@]" \ @@ -631,7 +631,7 @@ fi else _list_files tmp1 "$prepath$realpath$testpath" - compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \ + compadd $Uopt -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \ -s "$ISUFFIX" \ -W "$prepath$realpath$testpath" \ "$pfxsfx[@]" \ @@ -661,7 +661,7 @@ fi else _list_files tmp1 "$prepath$realpath$testpath" - compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \ + compadd $Uopt -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \ -s "$ISUFFIX" \ -W "$prepath$realpath$testpath" \ "$pfxsfx[@]" \ @@ -730,7 +730,7 @@ compquote tmp4 tmp2 tmp1 for i in "$tmp1[@]"; do _list_files tmp2 "$prepath$realpath${mid%/*/}" - compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp3/" \ + compadd $Uopt -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp3/" \ -s "/$tmp4$i$ISUFFIX" \ -W "$prepath$realpath${mid%/*/}/" \ "$pfxsfx[@]" $listopts - "$tmp2" @@ -761,7 +761,7 @@ else # Not a pattern match _list_files tmp1 "$prepath$realpath$testpath" - compadd -U -Qf -p "$IPREFIX$linepath$tmp4" \ + compadd $Uopt -Qf -p "$IPREFIX$linepath$tmp4" \ -s "$ISUFFIX" \ -W "$prepath$realpath$testpath" \ "$pfxsfx[@]" "$mopts[@]" $listopts -a tmp1