zsh-users
 help / color / mirror / code / Atom feed
From: Phil Pennock <Phil.Pennock@globnix.org>
To: Nick Croft <nicko@acay.com.au>
Cc: zsh-users@sunsite.dk
Subject: Re: zmodload zmv ?
Date: Wed, 20 Mar 2002 00:46:27 +0100	[thread overview]
Message-ID: <20020320004627.A28356@globnix.org> (raw)
In-Reply-To: <20020319232902.GB878@acay.com.au>; from nicko@acay.com.au on Wed, Mar 20, 2002 at 10:29:02AM +1100

On 2002-03-20 at 10:29 +1100, Nick Croft wrote:
> zmv looks to be a very handy utility. With Debian, it's located
> under /usr/share/zsh/4.0.4/functions/Misc  .
> 
> I've tried starting it with zmodload zmv - nothing.

zmodload is for loading dynamic code into zsh.  For your platform, ".so"
files.

"man zshmodules"

> I've moved, chowned, and chmodded it to a local fpath.

fpath/FPATH is searched for an undefined (-u) function; see zshparam(1).
To create such a function, use the autoload builtin; see zshbuiltins(1).

> What's the trick? All the googling points to the same paragraph being
> quoted. The source contains a pretty good description of its uses but no
> hint as to startup.

There are some example startup files which ship with zsh; you'll need to
check your package to see if they were included.

The example zshrc includes:

-----------------------------< cut here >-------------------------------
# Where to look for autoloaded function definitions
fpath=($fpath ~/.zfunc)

# Autoload all shell functions from all directories in $fpath (following
# symlinks) that have the executable bit on (the executable bit is not
# necessary, but gives you an easy way to stop the autoloading of a
# particular shell function). $fpath should not be empty for this to
# work.
for func in $^fpath/*(N-.x:t); autoload $func
-----------------------------< cut here >-------------------------------

For comparison, dating back a while, I have:
 autoload ${^fpath}/*(N:t)
and mine is broken.  I thought that I had the executable check in;
obviously I lost it at some point in the past few years.  Oops!

Someone else might be able to explain why it's better to loop over the
expanded list, autoload'ing each, rather than "autoload glob".
-- 
"Reading my work email is a nice break from the nasty sunshine" - Carel


  parent reply	other threads:[~2002-03-19 23:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-19 23:29 Nick Croft
2002-03-19 23:43 ` Bart Schaefer
2002-03-19 23:46 ` Phil Pennock [this message]
2002-03-19 23:47 ` Dennis Haney
2002-03-20  0:02   ` Nick Croft

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020320004627.A28356@globnix.org \
    --to=phil.pennock@globnix.org \
    --cc=nicko@acay.com.au \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).