Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Trouble with completion for a function
- X-seq: zsh-users 15476
- From: Ted Leung <twleung@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Trouble with completion for a function
- Date: Sat, 23 Oct 2010 21:14:56 -0700
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=sauria.com; h=from :content-type:content-transfer-encoding:subject:date:message-id :to:mime-version; s=sauria.com; bh=OGVYZmlK6KJ/pPA85+U1slkjLw0=; b=IglZf+ukqFyeh1vTJLSpjTgJaHd0VFYs/LNr3iiETTZ+n2y8xSXVlP8G6m7vN +PrNQihJgvbGMNN2IbxTc6Qk/moEwwcr6tUlGBv6nJ+grbVW6uWQUkp77sJjg+KD bPU36E8AxN0C2o3E4RL7FuK/Z/33OtbqVPMGuH0riIjxEk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=sauria.com; h=from:content-type :content-transfer-encoding:subject:date:message-id:to: mime-version; q=dns; s=sauria.com; b=AHfXifYY9wQ0CMVkBXKWweizH0R m5cI3VqWZT4tup4DNfTGCgV+4rkM688tnr4zw3lkHsxdX+eKf+WJkU2VcsIygeIY 5IWUvF8YeLFvPE7B2n5Jdhu9joyiupjq3mF8dj4JUTGVSnAdhKCqoYTJ7XTNY2D3 8HyepgdX6XF4Mp1s=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hi,
I'm trying to write a completion for a function. I only want the function arguments to be taken from the directory stack.
Here's the function
zq () {
# function zq -- cd, qualified by searching the dirstack.
# take only the LAST (== most recent) directory that matches. NoIC.
# zq_dest=$( dh | grep "$1" | tail -1 )
zq_dest=$( dirs -v | grep "$1" | head -1 )
set -- $=zq_dest
# echo pushd ${(j:\ :)argv[2,${#argv}]}
eval pushd "${(j:\ :)argv[2,${#argv}]}"
}
Here's the zstyle command that I think should be working
zstyle ':completion:*:*:zq:*:*' tag-order directory-stack
If I type 'zq ' and then c-x h, I get:
tags in context :completion::complete:zq::
all-files (_files _default (eval))
Could someone please give me some advice on what I am doing wrong, or how to debug this further?
Thanks in advance,
Ted Leung
Messages sorted by:
Reverse Date,
Date,
Thread,
Author