zsh-users
 help / color / mirror / code / Atom feed
* Writing Zsh "libraries"
@ 2006-06-19 13:07 Nikolai Weibull
  2006-06-20  7:38 ` Marc Chantreux
  2006-06-20  9:36 ` Peter Stephenson
  0 siblings, 2 replies; 4+ messages in thread
From: Nikolai Weibull @ 2006-06-19 13:07 UTC (permalink / raw)
  To: Zsh Users' List

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-06-21  1:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-19 13:07 Writing Zsh "libraries" Nikolai Weibull
2006-06-20  7:38 ` Marc Chantreux
2006-06-20  9:36 ` Peter Stephenson
2006-06-21  1:09   ` Deliverable Mail

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).