From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12127 invoked by alias); 18 Sep 2015 05:52:28 -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: 20582 Received: (qmail 5742 invoked from network); 18 Sep 2015 05:52:27 -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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=1VYuq/sjl/2Bn7lqh7uMJt5lzIQsbSj6U2ikErVRJlA=; b=F2n0S72auMcOMU3cBa0mbpVA/2Vwp2GUYJ5XaDBgFmlOTaJhVqVS770BZISngFDXop ZgRnyXcNBv4QJ5j31KcvO3dhJ07joX0iEjOaXVHka6cVMGqbBkosMOkQ52WIY3eWwHD3 5Gq0eelvh8Ml7i+8p3jixhbEBmQbHD6gg/MNnL5DNmzGGA7snu4kom0vvugibcdvjXhk KORFK+rsgV1e5x0QxRbcdtqA8F9tqhTu0RajnFEgObSbVkGMlr/uRQCy2pqyTHPuEX5W 4o+u5DeeWd0TPALMhodLgBsIdlc/2aORyR6Jff9PhXTl+EDuMqtsGGuQEN4MKLdr3XaG I5WQ== X-Gm-Message-State: ALoCoQnOxRdol0vqI4ULMBQH/+CG/nAozk+lsAII1iODr2Ck9Khk7lsDfYmwt3WNtlVLc1s0puzD X-Received: by 10.60.63.44 with SMTP id d12mr2380815oes.17.1442555544168; Thu, 17 Sep 2015 22:52:24 -0700 (PDT) From: Bart Schaefer Message-Id: <150917225221.ZM25880@torch.brasslantern.com> Date: Thu, 17 Sep 2015 22:52:21 -0700 In-Reply-To: <55FB9A50.4060903@eastlink.ca> Comments: In reply to Ray Andrews "Re: autoload" (Sep 17, 10:00pm) References: <55FAE223.2080502@eastlink.ca> <150917103419.ZM10067@torch.brasslantern.com> <55FB12FD.8000504@eastlink.ca> <150917134047.ZM10250@torch.brasslantern.com> <55FB476F.7080106@eastlink.ca> <150917162009.ZM10431@torch.brasslantern.com> <55FB66E8.5030503@eastlink.ca> <150917210453.ZM12575@torch.brasslantern.com> <55FB9A50.4060903@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: autoload MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 17, 10:00pm, Ray Andrews wrote: } } I guess the 'line 5 `)' error mystery is best } forgotten. Very strange tho. It's not a mystery. Try this: zsh -nf /usr/share/zsh/functions/Completion/Base.zwc } $ fpath=( /aWorking/Zsh/Source "${fpath[@]}" ) } $ source miscfunctions } $ autoload -w /aWorking/Zsh/Source/Source.zwc } $ l } [ nothing ] } $ l } [ now I get listing ] The way autoload works is, the name of the file has to be the same as the name of the function. If you "source" the file, you execute the file contents immediately, which in your case defines the functions. If you "autoload" the function names, you NEITHER define NOR execute them; you just mark them to be processed later. Then when you try to execute, zsh looks for a file with the same name as the function, parses it, and executes the result of the parse. Except for handling of the positional parameters, this is *almost* the same as functions[$filename:t]=$(