From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9581 invoked by alias); 16 Mar 2018 17:41:17 -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: List-Unsubscribe: X-Seq: 23250 Received: (qmail 10137 invoked by uid 1010); 16 Mar 2018 17:41:17 -0000 X-Qmail-Scanner-Diagnostics: from aurora-borealis.phear.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(94.242.205.164):SA:0(-1.9/5.0):. Processed in 7.059709 secs); 16 Mar 2018 17:41:17 -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,SPF_PASS, T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: khatar@phear.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: amavisd-new at phear.org DKIM-Filter: OpenDKIM Filter v2.10.3 aurora-borealis.phear.org 8247A112C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=phear.org; s=20180217; t=1521222061; bh=RzMO+lr6Fqq+PXs7dq42nA+F4l6la8GyEamaOiVn9bA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JBbfFcTL/FbVRokrWAInWhJmYnIp+0hPpAatkFwG9kPrxkhujijHoA9qBkCv0+EAD ojlEJ9vtglW+gDF2xqp5c00qtpSbmtYsRADD6azz5Pp7t1H/5qTog7Ea/6CCXu2zms 1hIKcAuDWl5Q8cnFJmkT1g+/IYlbZx0AST9CgmEFOSZSsn6kvgky7p+RKntXgNhfiu VbRc8iEO3FXfkO0n2Svy3raj6Af4YfWgx5uzDaJNga+VeJy1U1L3oWj9yT1TDQ6QuW YEYXdeUpMyl0wUBd9QAB7tTqo/hSY/Gsd0/AVpESwEvfT8wghtZp2RNjPhRmyFVwP1 a3zJxnKCrSDzA== Date: Fri, 16 Mar 2018 18:41:00 +0100 From: Marc Chantreux To: Ray Andrews Cc: zsh-users@zsh.org Subject: Re: real time alias? Message-ID: <20180316174100.ypudz735qaestycn@prometheus.u-strasbg.fr> References: <98aa0638-97ed-dfe0-8dd2-39129d02c084@eastlink.ca> <9001d78e-91fd-8505-518f-27247462d3c2@eastlink.ca> <20180315214450.sle4bsb3ab6dt56i@prometheus.u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) hello, > $ function test1 () > { >     test2 # unchanged since last sourcing of this function. >     setopt GRAB_ALIASES_AGAIN test2 >     test2 # Up-to-date. >     test3 > } you need to stack the alias definitions foreach aliases. what you need is an associative array of arrays ... and this is one of the boring limit of zsh (AFAIK): nested structures needs files. the best i have is: you cannot localize an alias but you can localize an array alias my@='typeset -a' my@ test2=( echo this is it ) () { my@ test2=( echo this is it ) $test2 } $test2 regards marc