From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 538 invoked by alias); 30 Dec 2012 10:52:40 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17507 Received: (qmail 15799 invoked from network); 30 Dec 2012 10:52:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:from:date:message-id:subject:to:content-type; bh=8lXzng1y98J5KAh6qC544tlpckGSv7a8lQ5XGRNvs1I=; b=Q3jYj2IBlKxnb6ZZUdYgrwCgRyB73LMCWfConSksuVbU2Zz85D6kN0N+OLq7iSAzYL iXej86NFe/lF92J3Z8XIJz/rh2zhxDc9UGbXuJhBkjoP46SaAALQKTFGCAmST6O984Yk SD/p9ItaK/YwsGYn+q6Tw4SAvrZcRRV2aHSfZKjgx6WNlMm/2kFTv/Eu3GdWjDC2TzlG mP8LT08drw16a/NhHOMmebec2xWFn9s6T2J8eZ64qUeOkAu1seySTwrIuBAwJVJwGQes lwWJirOeudd2YSNYLP+AdpnMbZi5wNHuOFWeGW2f0hyaiEFeAmiowkAmoQsrqUo4kpGr 3XPw== MIME-Version: 1.0 Reply-To: russ@eatnumber1.com From: Russell Harmon Date: Sun, 30 Dec 2012 04:44:01 -0500 Message-ID: Subject: Creating A Clean Environment For Autoloaded Functions To: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 If I want to write a function which can be autoloaded, how can I prevent functions defined outside of my function from being accessible from within my function? For example, I have a function ls { gls "$@" }, and I know of no way to prevent that function from leaking into the definition of all the functions I've autoloaded which use ls. Additionally, is it possible to zmodload a module which is automatically unloaded from the environment after my function completes _only if_ that module was not already loaded? -- Russell Harmon