Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Trouble with completion for a function



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