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

Re: Rough Draft of Article on Writing Completion Functions



[  date  ] 2002/04/05 | Friday | 10:57 AM
[ author ] Peter Stephenson <pws@xxxxxxx> 

> I deliberately didn't write a whole real-world completion function
> because there are already so many to look at, 

I think you should have done it, anyway.  I'll explain
why in a second.

> > The great tragedy of Zsh is that they actually made it very easy to
> > write completion functions, but you'd never know it by just
> > reading the documentation.
> 
> Hmm...  how much simpler than
> 
>   _foo() { compadd Yan Tan Tethera; }
>   compdef _foo foo
> 
> do I need to get?  This is the sort of hint I need from the puzzled.

Beginners don't need "simple".  They need "practical".
Would you tell some chump off the street:

    This is how to jab;
    This is a hook;
    This is an uppercut;
    Now go fight Mike Tyson.

Clearly, this guy is going to be unprepared for the task at hand.  

That's why a long practical example that explains the task of writing a
completion function from start to finish would have been helpful.

> I suggest you mention that you need zsh 4.0.x as a matter of priority,
> regardless of space limitations, or some people are going to get
> confused

OK.



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