From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3706 invoked by alias); 16 Mar 2018 18:13:45 -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: 23253 Received: (qmail 3121 invoked by uid 1010); 16 Mar 2018 18:13:45 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf0-f51.google.com 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(209.85.215.51):SA:0(-1.9/5.0):. Processed in 1.98819 secs); 16 Mar 2018 18:13:45 -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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CmvTvY5R+IUPWE9ocaMHitHbHHwMIRtEMkw4LsnARWk=; b=MCLeKbsm5BsW14mJw9nCJJ4oU2UceG2MiVa/+RX872eQoyKcNhoPlrzfyvUMjG3kWd dcvLGK/7RtWqRfw2x5T7AOnKJDniJJVkDrENxaIRc7twlAmJCD617u9JJrcOuli3Q0gg gKmBFFe+hCvOxb4eomxGCUhNUZX5t/JTRsqoUaRkay9NOOsgHfbxzz2Ib/3u2ooWtjqx NvByRDm//nOSsCh8/BVM2wek8pG9OO5Hdj61peXJgl3DiR2cHepCS/HlG+G3nrtRwrmy OxzNEtz9yF03ke7h2mUTMWkXPsD5/CugAphul5vISPZOpvxeTBhwl3DO/+QZ8wuq5TVU 7XZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CmvTvY5R+IUPWE9ocaMHitHbHHwMIRtEMkw4LsnARWk=; b=aMUnljdvcEPR3j22b8kWMTW80U2Z2djRgiIyINWiY9xz335U/2J03NQA21i4CTDUIH HmGVZvqjdctAfl52biogdFYJuqOn0H+2eHOyZTOmPyLWSBpnG04IgjXhW4otib9rC7yd oY5hoMpfEs889JaiXLySXkwbbxcL5haklMbZZTsAywC3aeDnCag/OEj/i2PfObgYenef CdPcdGaognHIXegjF19rIe0/5psbaRfJ+Vp4clScD+JX7Jh09w5S8mA526XWu1JrRZHj qO74L3MNQeHl6Jvm+PD3+Si8aKABEsHXVFNCUeLi7pnRKkPRE3FFr4zdUwWLvJic4V2w NmKw== X-Gm-Message-State: AElRT7F+RhOXw2v989NNMqOLAjTf5BLRCFCoD6dUu7JQFlNwfA3f2Xu6 8KhW9cPpOnepmKYFVWb4Xf/GRWdqnpMQ2cZJigVI3Q== X-Google-Smtp-Source: AG47ELtkXxUYWGAeFswRNR4tUKY0/aAPdiy8Cj1V7vqACDSzKtb+FfslLUrkPBNhLUrNm1E5jdLGfQsvmoA7EI2I8AU= X-Received: by 10.46.54.1 with SMTP id d1mr2103583lja.84.1521224018959; Fri, 16 Mar 2018 11:13:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <98aa0638-97ed-dfe0-8dd2-39129d02c084@eastlink.ca> <9001d78e-91fd-8505-518f-27247462d3c2@eastlink.ca> <20180315214450.sle4bsb3ab6dt56i@prometheus.u-strasbg.fr> From: Bart Schaefer Date: Fri, 16 Mar 2018 11:13:38 -0700 Message-ID: Subject: Re: real time alias? To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" On Fri, Mar 16, 2018 at 9:47 AM, Ray Andrews wrote: > > $ function test1 () > { > test2 # unchanged since last sourcing of this function. > setopt GRAB_ALIASES_AGAIN test2 > test2 # Up-to-date. > test3 > } The result of expanding an alias might include parens, braces, pipes, etc. - it can actually change the parsed syntax of the function body. So to "grab aliases again" you have to recompile the whole body of the function. The original (unparsed) body of the function is not stored anywhere, so to recompile it you have to get it back from wherever it originally appeared. That's easy if the function was autoloaded from your $fpath: % unfunction test1; autoload test1 If the function came from some larger file (such as .zshrc), or was defined at the command line, or was loaded from a plugin manager like Sebastian's, the details of how to reparse it will vary.