From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10262 invoked by alias); 6 Jan 2011 19:00:11 -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: 28585 Received: (qmail 22050 invoked from network); 6 Jan 2011 19:00:09 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.216.178 as permitted sender) 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 :content-transfer-encoding; bh=5Uxy6K2e8799JmaMxDEWV12f3eRHsZavmNpPebFz558=; b=Bl8OhOicSRzbOOeVHRdnbK9Br3Lo0o5HOtADGC5SeeF6JDNKzuWRFcpoqE/sLhG+WQ bbgRfQFSjDmg/4a5JxnQXROMDGSxJrQ9hHwDMTWhnZv4spoiN6UCNl7Fde2kkO0ZjmF1 o/UcFE6NFEYV+HUjnUW6i8DLYCdTDIP++XHcs= 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:content-transfer-encoding; b=mD2lYEuB7H2CSTlfk5hUQ7Hy4LuYBdMqsCKyeuIqLzOk1H6w5Jn1Rywi6tWxeLLEj2 EZ0IjTxdvDZ4X8/43LW1gTtdrONLPDDokdBQZ/1bX+JhUr0fBV4LcilEhfEe1haQ7y3Y rR3wJHtYCsbG3cDcEqj89aAU7ZFuHfgWF166w= MIME-Version: 1.0 In-Reply-To: References: <110106084111.ZM20766@torch.brasslantern.com> <110106092447.ZM20931@torch.brasslantern.com> Date: Thu, 6 Jan 2011 20:00:04 +0100 Message-ID: Subject: Re: matcher-list doesn't work with some completers? From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 6 January 2011 19:42, Mikael Magnusson wrote: > On 6 January 2011 18:24, Bart Schaefer wrote: >> On Jan 6, =C2=A08:41am, Bart Schaefer wrote: >>> >>> > ls dir #works >>> > du dir #nothing >>> >>> This is a bug in _du, it's returning a 0 status without ever adding any >>> matches, which causes _dispatch in turn to report success to _complete >>> which then skips running the matcher-list. >>> >>> This in turn is because _du checks for a state transition to handle the >>> --time and --time-style options, and that case statement masks the >>> return value from _arguments. > > I guess I'll have a go at fixing _mkdir then... Well, this is not my day. First I had _du in site-functions so nothing I did fixed it (I figured this out before sending the previous mail). Then as I was trying to fix _mkdir, I just did a cp **/_mkdir $fpath[3] to save some time. BUT of course I had -test-3 in that shell and the new shell had -dev-1 so that copy didn't have any effect. Heh. Anyway here is a patch for _mkdir: http://git.mika.l3ib.org/?p=3Dzsh-cvs.git;a=3Dpatch;h=3D80fbf4aa928361bb9f6= 0819c7b8d1922f1732487 Subject: [PATCH] _mkdir: don't set ret=3D0 when _wanted fails to find any m= atches --- Completion/Unix/Command/_mkdir | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Completion/Unix/Command/_mkdir b/Completion/Unix/Command/_mkdi= r index 927b9df..b5f7519 100644 --- a/Completion/Unix/Command/_mkdir +++ b/Completion/Unix/Command/_mkdir @@ -60,9 +60,8 @@ case "$state" in if (( $ret )) && [[ ! -prefix - ]] || \ [[ $variant =3D=3D zsh && ${#${${words[2,-1]}:#-*}} -gt 0 ]]; then _wanted directories expl \ - 'parent directory (alternatively specify name of directory)' \ - _path_files -/ || _message 'name of directory' - ret=3D0 + 'parent directory (alternatively specify name of directory)' \ + _path_files -/ && ret=3D0 || _message 'name of directory' fi ;; esac --=20 1.7.3 --=20 Mikael Magnusson