Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Writing Zsh "libraries"
- X-seq: zsh-users 10393
- From: "Nikolai Weibull" <now@xxxxxxxx>
- To: "Zsh Users' List" <zsh-users@xxxxxxxxxx>
- Subject: Writing Zsh "libraries"
- Date: Mon, 19 Jun 2006 15:07:16 +0200
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=oZ0AgjB/VKCStcpkwUjWYpPsPil34u8mOPn6UnP2EYDeb34JiayPSHEXaI6hbvMMXGsDJIarzMmr0suEuyykoeshh+zduLWPDSoiS5jpWNtSW9m4IdHFo/R8GaXdgldYpgQ4jSLo+IUY70gOPMV6FrFMmqQk9TUOki3BhdwBszw=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Sender: nikolai.weibull@xxxxxxxxx
As I have quite a few utilities written in pure Zsh, I've created a
small library of functions that I often (re)use. The question is how
to store such a library. Currently, I've just placed them in
$ZDOTDIR/functions/zap and then added that directory to $fpath. That
works fine, but I need to modify $fpath and prefix functions with
"zap-". Then I had the "brilliant" idea of removing the prefixes -
thus "zap-init" becomes "init" - and load them in the following manner
instead:
autoload -U zap/init
Then I simply call the function as "zap/init" ($ZDOTDIR/functions is
in my $fpath as well).
This works and seems to be quite a nice way to handle namespacing, but
perhaps I'm missing something vital here.
Any comments?
nikolai
Messages sorted by:
Reverse Date,
Date,
Thread,
Author