From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1310 invoked by alias); 18 Mar 2018 23:01:24 -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: 23259 Received: (qmail 1330 invoked by uid 1010); 18 Mar 2018 23:01:24 -0000 X-Qmail-Scanner-Diagnostics: from mail-pl0-f43.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.160.43):SA:0(-1.9/5.0):. Processed in 10.345844 secs); 18 Mar 2018 23:01:24 -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 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=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=yYnYBGQ975fidJpi1wpwA2k8kGtF3S5og8DCcMGsFRg=; b=ek7O8tORdNgADpIex+4KUsFC4ZxJMLRFJwcWUC+CFfjcub7RYEv5i2DBKKFpNkpXWJ D/n2YGTPTOCpYNCLmVpdzKUOWjQhiiYW00MxO85Ol/jQ2k4Ul/zHPtltKVsBD0hAjwJ3 R3QOQgMgs11widoIov8+R4Kmtcb8R4JtOlLa7UaJDWPeC76ZNpfJWZ+ApQbvxyoh86tW gdX0sucb46plMXsJOHeRPQkN8mpIS36cmAgvcHmCqpnpR1x/K9jKj3XrVzU+pSOBlOtl ZcX1OqWgCV9K3Vjlj5uM0q0lyMieFeG8BLulp9VtFXscTvwO5UOVTqNr8jQCXPBcEvgA Y9QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=yYnYBGQ975fidJpi1wpwA2k8kGtF3S5og8DCcMGsFRg=; b=p7MAcxkkDr1kNx2qi0ck+VQC9LiW+D18RidiYieMOqDbaK5SzwCgXgCIPXD8INQzlD MHCd2IMr2vPPfSMcZM+Y7CW1zo2V1/PQwILIqP5XtsVmhf4pGVtSzlpY3t2nDfB2pHYn OKnzKEbyOQYpv8Be0eHxMJ7Fp4CEcn/rbMnar/D/xnybz0EsMLitEGejjZyEDOZPFRp9 i0LOUX9xjG1eoUHFXHmBRlU4R/Hlmnoimqd2o55rfI/D9wRfclE8WipLgTJxUCHbFjgE 36l1vwEt5DQH440KYlZG1ijiNLL0HxviPG050d+SGvB/9XAR/MofkCbSpPKc7iodJ3nB N8Jw== X-Gm-Message-State: AElRT7GzFypx7dPC/dQsXpYEainjPXQHRjj4i2YsLU6jAnngm/QLFHRW cJ/H+3KlDaeVSl6LXTspEUZhLZMM X-Google-Smtp-Source: AG47ELvi/OioOW6jPtEdvharX0esQrMqSAx2jX2uhwnEOzJOswAmJoYoHWayAdcHvvFclNCTazMs8w== X-Received: by 2002:a17:902:66e6:: with SMTP id e93-v6mr10307811plk.312.1521414070945; Sun, 18 Mar 2018 16:01:10 -0700 (PDT) From: Bart Schaefer Message-Id: <180318160107.ZM8955@torch.brasslantern.com> Date: Sun, 18 Mar 2018 16:01:07 -0700 In-Reply-To: Comments: In reply to Ray Andrews "Re: real time alias?" (Mar 16, 11:56am) References: <98aa0638-97ed-dfe0-8dd2-39129d02c084@eastlink.ca> <9001d78e-91fd-8505-518f-27247462d3c2@eastlink.ca> <20180315214450.sle4bsb3ab6dt56i@prometheus.u-strasbg.fr> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: real time alias? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 16, 11:56am, Ray Andrews wrote: } } I get it. The function can't 'grab' a new version of the alias without } recompiling itself which ends up being far more trouble than it's } worth. Mind, my functions do know where they came from: } } (1)TYPE: c is a shell function from /aWorking/Zsh/Source/c: Sure, but it doesn't keep track of whether "c" is the ONLY function that came from that file. It wouldn't be safe to automatically re- source just any such file. Telling zsh which files can be sourced that way is the job of "autoload". It would be possible for every function to know whether it originally came in via "autoload" and have some criteria for whether to discard the current definition and re-load again. However, given the possible chain of dependencies (this alias depends on that function depends on some other alias depends on ...) it isn't practical to keep track of everything that might have gone into the definition of a function. Besides, we generally recommend NOT depending on aliases in autoloaded functions, and therefore using "autoload -U ...". Maybe this is a feature that Sebastian is interested in tackling in his plugin manager: Remembering functions that are autoloaded *without* -U in plugins that define aliases, and reloading them if the aliases are updated. Although it does seem ripe for unintended side-effects.