From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28923 invoked from network); 8 May 2001 19:57:07 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 May 2001 19:57:07 -0000 Received: (qmail 186 invoked by alias); 8 May 2001 19:57:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14271 Received: (qmail 173 invoked from network); 8 May 2001 19:57:01 -0000 From: "Bart Schaefer" Message-Id: <010508125610.ZM7477@candle.brasslantern.com> Date: Tue, 8 May 2001 12:56:10 -0700 In-Reply-To: <3AF833DA.85B97A2E@u.genie.co.uk> Comments: In reply to Oliver Kiddle "example startup file" (May 8, 6:58pm) References: <3AF833DA.85B97A2E@u.genie.co.uk> X-Mailer: Z-Mail Lite (5.0.0 30July97) To: Oliver Kiddle , zsh-workers@sunsite.dk Subject: Re: example startup file MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 8, 6:58pm, Oliver Kiddle wrote: > Subject: example startup file > > I've not commited this yet to allow for any objections. No objections; comments intermingled below. > Also, I'm not too happy with the autoload for loop: if it finds no > executable files in a directory it emits an error and returns. Does > anyone have any better suggestions which keep things simple. As I see > it, you either also loop for files or use the N nullglob flag and > redirect outout because autoload with no arguments outputs all > functions. I actually do *both* of those in my .zshrc ... autoload $dirname/*(N-.x:t) > /dev/null (The `-' is to follow symlinks, doesn't seem to be any reason not to.) However, if you know (as in the example) that fpath is non-empty, you can just do one loop like this: for func in $^fpath/*(N-.x:t); autoload $func > I get directories in fpath duplicated with this .zshrc after compinit > which isn't too good. Maybe typeset -U fpath should be the default? I use: typeset -U path cdpath fpath manpath > --- /home/kiddleo/cvs/zsh/StartupFiles/zshrc Mon Mar 26 00:41:02 2001 > +++ zshrc Tue May 8 18:42:07 2001 > @@ -42,19 +42,19 @@ > > # Shell functions > setenv() { export $1=$2 } # csh compatibility That never was csh-compatible. This is: setenv() { typeset -x "${1}${1:+=}${(@)argv[2,$#]}" } > +freload() { while (( $# )); do; unfunction $1; autoload -U $1; shift; done } I'd throw in a check that the argument actually is a function before calling unfunction on it. > +bindkey ' ' magic-space # also do history expansion on space That reminds me ... magic-space should magically turn itself off when there is a !" somewhere to the left of it on the line. As it is now, !" vanishes as soon as you type a magic-space, which sort of defeats the purpose.