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

Re: exposing completions data to user



Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:

> On Oct 18,  1:06am, Ben Veal wrote:
> }
> }    To do this I need access to the list of possible
> }    completions and their descriptions.
> }    As far as I can determine, this information is not
> }    normally available
>
> This is what the -O -A and -D options of the compadd builtin are meant
> to accomplish.  Are you capturing completions for a specific context
> for which you are writing the completion function, or are you trying
> generically to capture the strings that any completion would normally
> display via ZLE?
>
> If the former you should be able to structure your own compadd calls
> appropriately.  If the latter you might be able to get away with a
> wrapper around "builtin compadd ..." that changes the arguments; see
> for example what _approximate does.
>
> }    and so I need to write a module
> }    which exposes this data.
>
> If you determine that you do need to go this way, looking at the
> imlementation of the above compadd options is probably your best bet.

Yes, I want to get the completions and their
descriptions generically so that I can use zaw as an
alternative method for performing completions.

After poking around the source code some more it seems
that amatches[i]->matches[j]->str should contain the
completions (for different values of i and j). However
when I try exploring that datastructure at breakpoints
in the printlist, ilistmatches, and complistmatches
functions gdb tells me: "Cannot access memory at address 0x0" 
I get the same message when I try pmatches.

Any more advice?
-- 
 



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