From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1263 invoked by alias); 12 Sep 2015 19:47: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: X-Seq: 20543 Received: (qmail 9790 invoked from network); 12 Sep 2015 19:47:22 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1442086869; bh=f4r57RogiCRVtxATN7lXh2dBp+QMLA/pTHY6dIBR5Ds=; h=From:To:In-Reply-To:References:Subject:Date; b=gvkflgXFBxBaXnfLOOZGMyhOPOhahPZmYPEIlPtRcuQ8cBLuUZzAyd/iHyk39LuZx xzNWV09WIjeaMik5jNAyei2c3lPs6HdO4RJKvRl6B/eQIc2VbhiJo4WJGROpJJ93Ed 09x7I9ewarUK0c+RX16FUi03AYKkFZjW6M2sRQ7c= From: ZyX To: Ray Andrews , "zsh-users@zsh.org" In-Reply-To: <55F465E6.1040405@eastlink.ca> References: <55F465E6.1040405@eastlink.ca> Subject: Re: Announce of Zsh Navigation Tools MIME-Version: 1.0 Message-Id: <2125131442086868@web14o.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 12 Sep 2015 22:41:08 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 12.09.2015, 21:21, "Ray Andrews" : > On 09/08/2015 05:32 AM, Sebastian Gniazdowski wrote: >>  Hello, >>  I would like to announce Zsh Navigation Tools, > > ... > > Thanks for those Sebastian, I'm playing with them now, several look very > useful. One thing, I had to create > '/usr/local/share/zsh/site-functions'. I wonder if there is a location > for the files that is in keeping with my directory structure. A trivial > point: in the files, you call them 'functions' whereas they are scrips, > I believe. However, I'm tempted to convert them to functions anyway. They will work if located in *any* directory listed in $fpath. And they *are* functions, you need to read about autoload functions in man zshmisc, section AUTOLOADING FUNCTIONS: If the KSH_AUTOLOAD option is set, or the file contains only a simple definition of the function, the file's contents will be executed. This will normally define the function in question, but may also per‐ form initialization, which is executed in the context of the function execution, and may therefore define local parameters. It is an error if the function is not defined by loading the file. Otherwise, the function body (with no surrounding `funcname() {...}') is taken to be the complete contents of the file. This form allows the file to be used directly as an executable shell script. If pro‐ cessing of the file results in the function being re-defined, the function itself is not re-executed. To force the shell to perform initialization and then call the function defined, the file should contain initialization code (which will be executed then discarded) in addition to a complete function definition (which will be retained for subsequent calls to the function), and a call to the shell function, including any arguments, at the end.