From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26943 invoked from network); 11 Jul 2008 19:27:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Jul 2008 19:27:13 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 71931 invoked from network); 11 Jul 2008 19:27:04 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Jul 2008 19:27:04 -0000 Received: (qmail 15305 invoked by alias); 11 Jul 2008 19:27:01 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25277 Received: (qmail 15289 invoked from network); 11 Jul 2008 19:27:00 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 11 Jul 2008 19:27:00 -0000 Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bifrost.dotsrc.org (Postfix) with ESMTP id C47D280561C2 for ; Fri, 11 Jul 2008 21:26:44 +0200 (CEST) Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com with ESMTP id <20080711193300.ONVS16629.mtaout03-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Fri, 11 Jul 2008 20:33:00 +0100 Received: from pws-pc ([81.107.40.67]) by aamtaout02-winn.ispmail.ntl.com with ESMTP id <20080711193012.HWB29365.aamtaout02-winn.ispmail.ntl.com@pws-pc> for ; Fri, 11 Jul 2008 20:30:12 +0100 Date: Fri, 11 Jul 2008 20:26:36 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: PATCH: ksh_autoload safety cleanup Message-ID: <20080711202636.374ec266@pws-pc> In-Reply-To: <20080711083203.GA51766@redoubt.spodhuis.org> References: <20080711083203.GA51766@redoubt.spodhuis.org> X-Mailer: Claws Mail 3.4.0 (GTK+ 2.12.11; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.92.1/7693/Fri Jul 11 17:56:33 2008 on bifrost X-Virus-Status: Clean On Fri, 11 Jul 2008 01:32:03 -0700 Phil Pennock wrote: > I'd naively interpret that to mean that the ksh_autoload setting at the > time of the autoload/typeset determines it, rather than the value at the > time the function is eventually loaded. I'm not convinced that the > current behaviour is correct and am wondering if the -k/-z should be > implicitly provided instead. Is there any situation where declaring > autoload in one mode and then loading later in the other mode is likely > to be correct and/or desired? I don't imagine so, but the option was only designed as a single global setting so that users wouldn't need to think about it, so it's not surprising it doesn't work very well as a dynamic option and it's probably too late to change. If you use both regularly you need the flags. You can in any case already handle this along the lines of (this isn't a complete replacement but it gives you the idea): autoload() { if [[ -o kshautoload ]]; then builtin autoload -k "$@" else builtin autoload -z "$@" fi } -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/