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

Re: [PATCH] add-zle-hook-widget



On Jul 5,  4:57am, Daniel Shahaf wrote:
}
} Note there are alternatives to specifying detailed partial orders: for
} example, one could hook a single function that invokes a few other ones

This gives me an interesting idea:  The list of hook types is stored
in a zstyle.  So you could theoretically add your own new hook types
to that style, and hey presto, add-zle-hook-widget will let you manage
a hook "array" for your new hook name.

    azhw:zle-new-hook-name() { ... }
    zle -N zle-new-hook-name azhw:zle-new-hook-name
    $(zstyle -L zle-hook types) new-hook-name

    add-zle-hook-widget new-hook-name some-other-widget
    add-zle-hook-widget new-hook-name yet-another-widget

Then you can add all of your hooks to one of the built-in hooks like

    add-zle-hook-widget line-init zle-new-hook-name

Hmm.



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