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

Re: PATCH: _zmodload



Oliver Kiddle wrote:

> ...
> 
> Well here is the _arguments version and I've also tried to make use of
> the $modules parameter where possible. Is my strategy of retricting the
> arguments to _tags and then completing everything in the while _tags
> loop okay? It seems to work and was the easiest way I could find to
> handle _zmodload seeing as it has all the flags first.

Yes, that's ok. Of course, one could use multiple loops when _zmodload 
is changed to complete the things needed by zmodload. E.g. completion
after `zmodload -ac foo <TAB>' completes builtins, which is wrong. The 
same for -ap etc.

Another questionable completion is `zmodload -A <TAB>'. That completes 
modules files, but we need an alias name (something we can't really
complete at that point, because the user almost certainly wants a new
alias name).

And those builtins completed... offering the builtins currently
defined is a simple solution for a hard problem, but will be wrong in
most cases. For the modules we have currently, the builtins could be
derived with something like `nm <module> | grep bin_'. Unfortunately,
this isn't guaranteed to be correct and won't work for autoloaded
parameters, conditions and so on anyway. Maybe trying to find a .mdd
file and looking at it would be a better solution. Or maybe giving up
and doing what _zmodload does now... sigh.


The patch makes the return value built be used.

Bye
 Sven

Index: Completion/Builtins/_zmodload
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_zmodload,v
retrieving revision 1.6
diff -u -r1.6 _zmodload
--- Completion/Builtins/_zmodload	2000/08/18 17:21:58	1.6
+++ Completion/Builtins/_zmodload	2000/08/21 07:59:44
@@ -44,3 +44,5 @@
   _requested aliases expl 'module alias' \
     compadd "$suf[@]" -k 'modules[(R)alias*]' && ret=0
 done
+
+return ret

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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