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

Re: exposing completions data to user

On Oct 25,  5:16am, Ben Veal wrote:
} Yes, I want to get the completions and their
} descriptions generically so that I can use zaw as an
} alternative method for performing completions.
} Any more advice?

I didn't think I had anything to add, but I found something else that
may help:

Look at Etc/zsh-development guide in the section on hooks.  There is
a set of hooks defined by the zsh/zle and zsh/complete modules that
you can use to intercept various completion operations.  (Depending
on how recent your zsh source is, you may need to look through the
source code to find all of these hook names.)

If your module adds a hook for "comp_list_matches", that *replaces*
the normal completion listing and instead passes the matches to your
module's callback in a struct chdata as defined in Src/Zle/comp.h (at
the very end of the file). This is actually the head of a linked list
of struct cmgroup that contain all the matches, so you'll have to
walk that list yourself.

Happy hunting.

Messages sorted by: Reverse Date, Date, Thread, Author