zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-users@sunsite.dk (Zsh users list)
Subject: Re: zsh libs
Date: Fri, 30 Jun 2006 13:56:56 +0100	[thread overview]
Message-ID: <200606301256.k5UCuu32025600@news01.csr.com> (raw)
In-Reply-To: <20060630124048.GA18152@ulpmm.u-strasbg.fr>

Marc Chantreux wrote:
> hello,
> 
> Few days ago, Nikolai Weibull told us about autoload to deal with
> namespaces. I'm trying to use this tips for my own libs.
> 
> I load my new lib with autoload -U but when i execute the function for
> the first time, it wasn't executed.
> 
> does anyone knows why ?
> 
> 
> > fpath+=$PWD
> > cat ldap/new
> #autoload ldap/read ldap/write ldap/new
> 
> ldap/new  ()  { print "new ..."  }
> ldap/read  () { print "reading ..."  }
> ldap/write () { print "writting ..." }

In zsh's standard form of autoload the file contains just the function
body, so that all that happens when it's first executed is that the
functions contained inside are defined.  This is different from other
shells.

However, it's simple to convert the file you've got:  just add

  ldap/new "$@"

to the end of the file.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


  reply	other threads:[~2006-06-30 12:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-30 12:40 Marc Chantreux
2006-06-30 12:56 ` Peter Stephenson [this message]
2006-06-30 16:27   ` Bart Schaefer
2006-06-30 18:22 ` Prompt truncating Timothy Stone
2006-06-30 19:22 ` Timothy Stone
2006-06-30 20:13   ` Prompt truncating... [CLOSED] Timothy Stone

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=200606301256.k5UCuu32025600@news01.csr.com \
    --to=pws@csr.com \
    --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).