Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: matcher-list doesn't work with some completers?
- X-seq: zsh-workers 28585
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: matcher-list doesn't work with some completers?
- Date: Thu, 6 Jan 2011 20:00:04 +0100
- 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=
- In-reply-to: <AANLkTi=m-sFf6+uXYV7k17i4rW2r7c0LZB9G4WmL6EfC@xxxxxxxxxxxxxx>
- 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: <AANLkTinw=XEV+CA1wuMcNEpdXb--A2e42QcCf_TdbKYg@xxxxxxxxxxxxxx> <110106084111.ZM20766@xxxxxxxxxxxxxxxxxxxxxx> <110106092447.ZM20931@xxxxxxxxxxxxxxxxxxxxxx> <AANLkTi=m-sFf6+uXYV7k17i4rW2r7c0LZB9G4WmL6EfC@xxxxxxxxxxxxxx>
On 6 January 2011 19:42, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On 6 January 2011 18:24, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> On Jan 6, Â8:41am, Bart Schaefer wrote:
>>>
>>> > ls dir<tab> #works
>>> > du dir<tab> #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=zsh-cvs.git;a=patch;h=80fbf4aa928361bb9f60819c7b8d1922f1732487
Subject: [PATCH] _mkdir: don't set ret=0 when _wanted fails to find any matches
---
Completion/Unix/Command/_mkdir | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/Completion/Unix/Command/_mkdir b/Completion/Unix/Command/_mkdir
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 == zsh && ${#${${words[2,-1]}:#-*}} -gt 0 ]]; then
_wanted directories expl \
- 'parent directory (alternatively specify name of directory)' \
- _path_files -/ || _message 'name of directory'
- ret=0
+ 'parent directory (alternatively specify name of directory)' \
+ _path_files -/ && ret=0 || _message 'name of directory'
fi
;;
esac
--
1.7.3
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author