Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Quote components before using it is pattern
- X-seq: zsh-workers 28187
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Quote components before using it is pattern
- Date: Sat, 21 Aug 2010 19:25:49 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=93anoTYwaABbeUkoSs2qh6UraiY2eI1K3wjVYbHcEfc=; b=FpGcCjJPGX3X0UqvRe3GQP1B7OuuGyuqMa/P62FAgI1SIVZi0VvJDhEZqxmP/rPUvV v+rq0GfTlAE4boKr+R5Wz1j5kdynuUtJhbM1QhzDGbzarRaceFjhorim2joWOXrx3ze3 y9bL2v2bmnb5s3tZNEjwZCKvD2Jywv/cdE2pQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=nV+3Q+uW/uRTXPXyPnpfKeCgZ5/d+fUj3B8KP+e3FkcPrPg98y9DOGHQ53Vtzs0qbf aS3hoe9FN5en1lNLEGVz5taOoxVHsHiH2lmqhyJZOYJoW4+qvHjFEtAFCXXeIDc3XPLU H9Q3HDPKCLS8kCEDCwUXAEMUOrItDdLWypu+I=
- In-reply-to: <100821101209.ZM31841@xxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1223938893-2537-1-git-send-email-joerg@xxxxxxxxxxxx> <20081014150144.GA3836@xxxxxxxxxxxx> <AANLkTimzOEX5ZvUorwx2UsvT2u+YjDfER6Gt6E1CZMvL@xxxxxxxxxxxxxx> <100821095410.ZM31747@xxxxxxxxxxxxxxxxxxxxxx> <100821101209.ZM31841@xxxxxxxxxxxxxxxxxxxxxx>
On 21 August 2010 19:12, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 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
This seems to work for me too (assuming it did for you anyway :). I
tried both testcases here, and completing my zip and tar files, and it
all completed correctly.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author