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

Re: Completion/User functions again



Sven Wischnowsky wrote:

> I've been thinking about this for a long time, too. The problems are
> that we would have to fill those directories (so that they don't look

I don't think it would matter too much if they were on the empty side
while we are still on version 3.1.x.

> silly) and with such directories users would expect to need only to
> copy the contents of one such directory (or link User to it), so they
> would have to be (almost) complete. That's a lot of work and who'll do
> that, I wonder.

Linking User to the directory probably wouldn't be the best approach
because there are many commands for which the completion won't be system
specific. I would go for an approach similar to that for installing
modules so users can add directories to install to a file listing the
completion directories. The configure script could possibly be enhanced
to intelligently add any appropriate directories. I would also subdivide
the User directory a little. For example if all the X programs were in
their own directory then they could be excluded on a system which lacks
X. We might later add directories for obscure software which would only
be relevant to a small number of users. This is a large reason why I
prefer the directories to be preserved with the installation (via
--enable-function-subdirs) and think it should be the default.

> While we are at it: we still don't have completion functions for some
> commands for which we have compctl examples, e.g. cvs and rpm. I don't
> use either of these often enough to be able to write good functions
> for them -- any volunteers for that?

I don't use rpm or cvs either so I won't volunteer for those but there
are many other programs for which I plan to write completions - I had an
enormous number of tcsh completes which I have yet to convert to zsh.
I've got a few IRIX/AIX specific ones which I'll contribute if and when
we have directories set up to accomodate them.

> Maybe we should add some kind of programming style guide some day,
> containing things like `make functions that can be used as helper
> functions do something useful with their arguments if possible' and
> `do not use compgen if you're only after the -k or -s options'
> (compadd is faster and -- I think -- cleaner for this).

A programming style guide would certainly be a good idea and its
usefulness would not be limited to writing zsh completions. It might be
a good idea to start one off as a simple text file, listing key points
particularly any which aren't immediately obvious like the compadd
point. We can always convert it to LaTeX/yodl/texinfo/whatever and
expand it into a readable document later.

Oliver Kiddle



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