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

Yet another completion question



Hi Folks:

I have a completion that works in the old form and would like
to write a completion function.  This is for a command called
"open" on Apple OS X.

eg: open -a Netscape

is the functional equivalent of clicking on the Netscape application,

eg:  open -a Microsoft\ Word

opens the devil's ware, etc.

I have a function that produces a list of applications, complete with
escaped spaces, like this:

Microsoft\ Word
NFS\ Manager
Nemo_invoker
NetInfo\ Manager
NetRestore
NetRestore\ Helper
Netscape


and I am using compctl to read in a file it produces, since this takes
awhile to produce:

 compctl -f  -x 'c[-1,-a] p[2,2]' -s "$(cat ~/.zshapplist)" \
          -M 'm:{A-Za-z}={a-zA-Z} r: ||[^ ]=**' -- open

This works.  I figured out the -s was critical to getting this to
work right with the applications having escaped spaces.

But what I would like to do is use the new completion system and cache
these completions in the proper z-shell manner.


I can't seem to figure out how to use compadd syntax in analogy to the -s
option of compctl.

I would be grateful for any and all suggestions.

Bill Scott


William G. Scott

Associate Professor
Department of Chemistry and Biochemistry
and The Center for the Molecular Biology of RNA
Sinsheimer Laboratories
University of California at Santa Cruz
Santa Cruz, California 95064
USA



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