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

Re: Example of using "-command-line-" context?



Bart wrote:
> The _normal function installs itself with "#compdef -command-line-" but, as
> the documentation explains, nothing uses that context.
> 
> This must be intended as an entry point for user-defined widgets that don't
> want to invoke the entire compsys machinery?  If not that, then what?  It's
> mentioned in http://www.zsh.org/mla/workers/2000/msg02232.html as a helper
> for completing after the "zse" (zstyle edit) function, but there was no
> follow-up showing it actually put to use.

I think the intention is functions using vared that do want to invoke
the compsys machinery.

Normally, vared just gives you filename completion,
  compcontext="-command-line-" vared -c foo
treats it as a single command-line. It doesn't look ideal for zse as
there's no splitting on newlines.

I can't say I have a real example, though I have used compcontext with
other values.

I've also got a script using vared that does completely avoid compsys.
It uses zle -C explicitly and also needs to do stuff with
compstate[insert] that _main_complete normally does for you.

Oliver



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