Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
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 <d.s@daniel.shahaf.name>
To: Bart Schaefer <schaefer@brasslantern.com>
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)
X-Seq: zsh-workers 38775

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

