Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] add-zle-hook-widget
- X-seq: zsh-workers 38854
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] add-zle-hook-widget
- Date: Thu, 14 Jul 2016 00:45:19 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;        h=from:message-id:date:in-reply-to:comments:references:to:subject         :mime-version;        bh=dCJnG+0CGv+dCjxg097Yq4rMMN9WdmXEEEJwszVzwqk=;        b=YzVj8gUanlVd5jrNSLAPLTytfhg8g7/9GaC2q/xDit1hqyvHE7CGNov+izul9/Q7Rz         5MKNAT/xiLBPmwaJ3MLsKzcZwp5hqOdBgCKgpBrUJAyGeNkQZ+rqp5lhJi/slNHyNYxt         inBvUe+HJeJW2wjQTJXCXjbqNQeiQemmLAogzh6C2HCanxFBWzX2Curse6XlJpt/4Pvn         Vc2Q3juPFyzJdp9T+yEs2e9D3hrFc2X4Gj0Y2KU4Mc7ZpdDhoFxaodSQQhYAbL6hSi4D         4Owt/j2UtsDnL/TuBQj5Dkaf7NBdeP8OFMcr89urNpPLO45vxWIhAq5I9ivivu7MqygM         gTjw==
- In-reply-to: <20160705045757.GD11492@tarsus.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <160612184453.ZM11316@torch.brasslantern.com> 	<20160613085219.GA23148@tarsus.local2> 	<160614111054.ZM17893@torch.brasslantern.com> 	<20160615232447.GA29225@tarsus.local2> 	<160616222055.ZM27034@torch.brasslantern.com> 	<20160621014130.GA17100@tarsus.local2> 	<160701131158.ZM9615@torch.brasslantern.com> 	<20160705045757.GD11492@tarsus.local2>
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