From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25407 invoked by alias); 30 Oct 2015 03:16:37 -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: 20861 Received: (qmail 3402 invoked from network); 30 Oct 2015 03:16:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=XuA4oKv640+/6mWP3bIz+g==:117 a=XuA4oKv640+/6mWP3bIz+g==:17 a=N659UExz7-8A:10 a=V2YHTTGmplfYIzfGAmYA:9 a=pILNOxqGKmIA:10 Message-id: <5632E10F.5050301@eastlink.ca> Date: Thu, 29 Oct 2015 20:16:31 -0700 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: alias not found References: <56328272.40709@eastlink.ca> <151029165313.ZM18037@torch.brasslantern.com> In-reply-to: <151029165313.ZM18037@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 10/29/2015 04:53 PM, Bart Schaefer wrote: > On Oct 29, 1:32pm, Ray Andrews wrote: > } > } $ . ./navtools; type naliases; naliases > } naliases is an alias for n_aliases > } zsh: command not found: naliases > > The entire line ". ./navtools; type naliases; naliases" has already > been parsed into bytecode before any of it is executed. So when > navtools creates the alias, it's too late -- naliases has already > been consumed and is not subject to alias replacement until another > subsqeuent chunk of input is presented to the parser (effectively, > not until after the next PS1 prompt is printed). > > This is one reason aliases are a bad idea in general. It would be > much better if navtools used e.g. > > function naliases { n_aliases "$@" } > Ok, that's one of those little things that's easy to get wrong. I'm thinking of each command being finished and returned before the next one is even looked at. Is there some fix for that? Which is to say, can we force sequential execution? It seems this sort of thing is only a problem with aliases, or at least that I've seen so far.