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

PATCH: use _math for let; Completing parameters



The patch makes _math be used for the let builtin.

One of the things which I would like to do in a few contexts when I am
completing parameters is to either complete only parameters of a
particular type or use a sort of tag-order (i.e. complete integers first
and then any other parameter). _math for example would clearly benefit
from only completing integer and float parameters. _parameters as it is
currently doesn't lend itself to doing this with styles. What would be
the best way to do this? What I was thinking of was to add an argument
to _parameters (what option letters are safe? -t?) which could specify
(as a pattern) those parameter types to complete. _parameters would use
this in conjunction with anything specified by a user's zstyle
configuration. How should I handle the zstyle defined type: I think the
best way is to have it override any specified by the parameter to
_parameters and warn people in the documentation not to use the style in
a general context. How could this then work with a tag-order situation?
The easy way in the completion function would be to call _parameters
twice, the second time only if the first didn't find any matches but I
can't see how this could combine with a user specified tag-order.

Oliver

Index: Completion/Base/_math
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/_math,v
retrieving revision 1.1.1.7
diff -u -r1.1.1.7 _math
--- Completion/Base/_math       2000/03/23 04:19:26     1.1.1.7
+++ Completion/Base/_math       2000/05/09 17:10:35
@@ -1,4 +1,4 @@
-#compdef -math-
+#compdef -math- let

 if [[ "$PREFIX" = *[^a-zA-Z0-9_]* ]]; then
   IPREFIX="$IPREFIX${PREFIX%%[a-zA-Z0-9_]#}"



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