From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 218 invoked by alias); 21 Aug 2010 17:12:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28186 Received: (qmail 16135 invoked from network); 21 Aug 2010 17:12:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100821101209.ZM31841@torch.brasslantern.com> Date: Sat, 21 Aug 2010 10:12:09 -0700 In-reply-to: <100821095410.ZM31747@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: [PATCH] Quote components before using it is pattern" (Aug 21, 9:54am) References: <1223938893-2537-1-git-send-email-joerg@alea.gnuu.de> <20081014150144.GA3836@alea.gnuu.de> <100821095410.ZM31747@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: [PATCH] Quote components before using it is pattern MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Aug 21, 9:54am, Bart Schaefer wrote: } } As has come up elsewhere, the problem is that ${(q)...} is a bit too } aggressive for the purpose to which it is being put. We need to quote } pattern characters in tmp1, but not other characters like spaces. Or maybe we're just being too clever trying to construct an (...|...) pattern and the right thing is just to not quote anything: Index: Completion/Base/Utility/_multi_parts =================================================================== diff -c -r1.6 _multi_parts --- _multi_parts 4 Nov 2008 04:47:52 -0000 1.6 +++ _multi_parts 21 Aug 2010 17:09:09 -0000 @@ -127,7 +127,8 @@ return fi elif (( $#tmp1 )); then - local ret=1 + local ret=1 tt + local -a mm # More than one match. First we get all strings that match the # rest from the line. @@ -144,7 +145,11 @@ SUFFIX="$suf" fi - matches=( "${(@M)matches:#(${(j:|:)~${(q)tmp1}})*}" ) + for tt in $tmp1 + do + mm+=( "${(@M)matches:#$tt*}" ) + done + matches=( $mm ) if ! zstyle -t ":completion:${curcontext}:" expand suffix || [[ -n "$menu" || -z "$compstate[insert]" ]]; then