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

RE: PATCH: more fun with `zle'



>
> And: all of this is only a suggestion for things that may be
> interesting to have. I'm not really happy with the argument-parsing
> and -naming of `zle' (and I never really understood why we have to
> have the concept of a widget -- maybe a special builtin/shell
> function-type would be more appropriate nowadays; but that's a
> different story).
>

As I understand it, it gives you additional flexibility. You can have a single
function that is linked to more than one widget. Widget name is available so
function can behave differently. Currently I have e.g. function

((${+NUMERIC})) || zle .set-local-history
if [[ $WIDGET == .* ]]
then
    zle $WIDGET
else
    zle .$WIDGET
fi
((${+NUMERIC})) || zle .set-local-history

and redefine all *history* widgets to use this function. Implementing the same
directly as function would depend on FUNCTIONARGZERO setting.

/andrej



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