From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12493 invoked by alias); 28 Jan 2017 20:38:07 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40448 Received: (qmail 17979 invoked from network); 28 Jan 2017 20:38:07 -0000 X-Qmail-Scanner-Diagnostics: from new2-smtp.messagingengine.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(66.111.4.224):SA:0(-0.4/5.0):. Processed in 1.043797 secs); 28 Jan 2017 20:38:07 -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=-0.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint2@fastmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf.messagingengine.com designates 66.111.4.224 as permitted sender) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=6PZWG5BkdabpNpXfZZE4Lin4vp Q=; b=VQjXXxwkUMt/Ch5CjaH5kaRILUWpVbvcj6HSO6h6XETEx+hx1uA+ZZUq++ 6+RF38xy2GMH+kDaz4ZesEM2aTrnNzCLPBfwtKr/MbzTi1AVYZDaQNny4R11ZwUy egOLY4GvFKKK1Wv0jD3LQOEwW3/VzHOSDn5Tu1y/rkyHjTKWw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=smtpout; bh=6P ZWG5BkdabpNpXfZZE4Lin4vpQ=; b=mSsJgyRt2h+2bd83IIbwuEdYV0XzXWYSMo GHKYn2qMj3rkFE6Zh01AB1kn/zwjdcwGMuOIWuwfB3N2Xx9x2PNA3QnHaYIEeQKM bP5HSQfDpxQmqJamVQ/fpx/YrtMeyk65r4jGslDTjuv+D93i6U3Cg4VlcEe2Lkgo imJzYdBjg= X-ME-Sender: Message-Id: <1485635878.2265091.862652176.5670C0E9@webmail.messagingengine.com> From: Sebastian Gniazdowski To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-37809a74 Subject: Re: PATH: autoload with explicit path In-Reply-To: <20170128195639.532f3874@ntlworld.com> Date: Sat, 28 Jan 2017 12:37:58 -0800 References: <1485529979.987251.861563792.06CCDCAC@webmail.messagingengine.com> <20170127162440.10a5c85b@pwslap01u.europe.root.pri> <1485542415.1037033.861766968.196E6FB9@webmail.messagingengine.com> <20170127184448.5591e976@pwslap01u.europe.root.pri> <20170128191248.4718b24c@ntlworld.com> <20170128195639.532f3874@ntlworld.com> On Sat, Jan 28, 2017, at 11:56 AM, Peter Stephenson wrote: > On Sat, 28 Jan 2017 11:45:36 -0800 (PST) > Bart Schaefer wrote: > > Well yes, the option would be on the autoload of the bootstrap function, > > i.e., > >=20 > > autoload -P /some/hard/path/foo > >=20 > > where "foo" in turn calls "autoload bar" would cause the autoload of bar > > to inherit /some/hard/path from foo. >=20 > Oh. That just doubles my suspicion that autoloading bar at the point > where you autoload foo is the right thing to do and anything else is > just getting you into the most horrible tangle. I could copy calendar to /some/hard/path, modify and load it without daunting task of altering FPATH. It's like a software package. This simple approach shows that this isn't something really confusing. For example, I could have in fpath: /home/user/functions /usr/local/share/zsh/site-functions /usr/local/share/zsh/5.2-dev-2/functions /home/user/functions2 Now, if I invoke "autoload calendar", from where it will be loaded? First containing directory. With the new functionality, I could load from anywhere I would want =E2=80= =93 this is simpler than maintaining proper FPATH: autoload -P /home/user/functions2/calendar autoload -P /usr/local/share/zsh/site-functions/calendar etc. Such operation of using absolute paths is zshrc-like, a final stage where instead of generalizing, we are defining. The rest is still generalized =E2=80=93=C2=A0all paths in function files are still general. O= nly the top (zshrc) is specific. I think that this will make Zsh so much flexible that setups involving not typical 2-3 function directories (FPATH=3Dmy-own-functions:Zsh-default-functions), but say 5 paths will get common =E2=80=93 /home/.zsh/calendar1:/home/.zsh/calendar2 =E2=80=93=C2=A0d= oing this with FPATH is rather impossible. With FPATH it's natural to add just 1 or 2 additional layers on top of /usr/local/share/zsh/5.2/functions, adding more is just too demanding. --=20 Sebastian Gniazdowski