From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3056 invoked by alias); 21 Jun 2016 01:48:15 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 38724 Received: (qmail 28587 invoked from network); 21 Jun 2016 01:48:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Date: Tue, 21 Jun 2016 01:41:31 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: [PATCH] add-zle-hook-widget Message-ID: <20160621014131.GB17100@tarsus.local2> References: <160612184453.ZM11316@torch.brasslantern.com> <20160613085219.GA23148@tarsus.local2> <160614111054.ZM17893@torch.brasslantern.com> <20160615232447.GA29225@tarsus.local2> <160616222055.ZM27034@torch.brasslantern.com> <160618162558.ZM5244@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <160618162558.ZM5244@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Sat, Jun 18, 2016 at 16:25:58 -0700: > On Jun 16, 10:20pm, Bart Schaefer wrote: > } > } What you have convinced me is that in the absence of an explicit index > } there's some value in retaining the order in which the add-* calls > } were made, which the code as last pushed doesn't. > > The following implements this, as well as fixing some bugs, most notably > that "setopt ksharrays" broke a bunch of stuff. > > There may still be other problems, and of course the discussion with Daniel > hasn't really finished yet. Yes, I'm replying as often as I can, but these days that's not as often as I'd like ☹ > for hook in $hooktypes > do > + # Check for an existing widget, add it as the first hook > + if [[ ${widgets[$hook]} = user:* ]]; then > + zle -A "$hook" "${widgets[$hook]}" > + zstyle -- "$hook" widgets 0:"${widgets[$hook]}" The last parameter expansion should strip the "user:" prefix. > + zle -N "$hook" azhw:"$hook" > + fi Cheers, Daniel