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

Re: PATCH: pass name ($0) and zmult ($1) to user-defined widgets



Bart Schaefer wrote:
>User-defined widgets should be able to change their behavior or repeat
>their action when given a digit-argument.

Yes.  But that should not be done via positional parameters.  I have
deliberately avoided passing arguments in positional parameters, so
that one widget can reliably call another without having to fiddle with
the parameters.  The numeric prefix should go into a special parameter,
or be accessible by some other mechanism.

>                                           They also ought to have a
>usable $0 when FUNCTION_ARGZERO is set; I chose to pass the widget name,
>so if you bind the same function to different widgets you can test for
>$0 to tweak the behavior.

That's a good idea.

-zefram



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