Subject: Re: [PATCH] add-zle-hook-widget
From: Daniel Shahaf <[email-masked]>
To: Bart Schaefer <[email-masked]>
Cc: [email-masked]
Date: Fri, 01 Jul 2016 05:11:07 +0000
List-Id: Zsh Workers List <zsh-workers.zsh.org>

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