From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4174 invoked by alias); 1 Jul 2016 05:17:50 -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: 38775 Received: (qmail 5032 invoked from network); 1 Jul 2016 05:17:49 -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: Fri, 01 Jul 2016 05:11:07 +0000 From: Daniel Shahaf To: Bart Schaefer Cc: zsh-workers@zsh.org Subject: Re: [PATCH] add-zle-hook-widget Message-ID: <20160701051107.GA27492@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> <20160621014130.GA17100@tarsus.local2> <160622132541.ZM12746@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <160622132541.ZM12746@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Wed, Jun 22, 2016 at 13:25:41 -0700: > On Jun 21, 1:41am, Daniel Shahaf wrote: > } Subject: Re: [PATCH] add-zle-hook-widget > } > } > I'm not sure there's a way to make it safe for all three of autoload +X, > } > source, and kshautoload. > } > } Wouldn't the following work? > } > } $ cat f > } f() { echo I have been called with "$@" } > } if [[ "$zsh_eval_context" != *\ file && ! -o kshautoload ]]; then > } f "$@" > } fi > > I don't think this correctly handles the case where "autoload -k" is used > but kshautoload is not actually set when the function is first called. > There's also the reverse case, where kshautoload IS set but the function > was declared with "autoload -z", to be considered. Any comments on the rest of my email, particularly on the idea to use topological sorting instead of indices? I realise you may not have time to implement it yourself, but I wanted to hear your opinion on the proposed change. (I wouldn't normally ping, but this is a not-yet-released API so I'd like to get it right before we're bound by backwards compat.) Cheers, Daniel