From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 616 invoked from network); 8 Feb 1999 19:17:53 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Feb 1999 19:17:53 -0000 Received: (qmail 1293 invoked by alias); 8 Feb 1999 19:16:32 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2119 Received: (qmail 1283 invoked from network); 8 Feb 1999 19:16:29 -0000 Date: Mon, 8 Feb 1999 14:15:34 -0500 From: Sweth Chandramouli To: zsh-users@sunsite.auc.dk Subject: Re: setopt and alias questions Message-ID: <19990208141534.A4151@astaroth.nit.gwu.edu> Mail-Followup-To: zsh-users@sunsite.auc.dk References: <19990207193735.A2060@astaroth.nit.gwu.edu> <990207175931.ZM8940@candle.brasslantern.com> <19990207235214.A2653@astaroth.nit.gwu.edu> <990207233343.ZM10079@candle.brasslantern.com> <19990208103038.A3447@astaroth.nit.gwu.edu> <990208104550.ZM14297@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i In-Reply-To: <990208104550.ZM14297@candle.brasslantern.com> On Mon, Feb 08, 1999 at 10:45:50AM -0800, Bart Schaefer wrote: > } > } aside from global aliases, is there any reason > } > } to not put all of my aliases into equivalent functions? > } > > } > Probably not. (Functions aren't exported either, though.) > } no, but they can be dropped in a .zfunc folder, so that > } only an autoload loop needs to be put in .zshrc for all shells to > } have access to them. > > You don't even need a loop. > > autoload $^fpath/*(.:t) i don't like error messages, however, so i use the loop to test for the existance of autoloadable files before doing the actual autoload: for DIRNAME in ${fpath} ; do if [[ -x ${DIRNAME}/*(.x:t) ]] ; then autoload ${DIRNAME}/*(.x:t) fi; done; > Can you figure out what this is doing? what my modulo2 binary-value loop did much more painfully. > (Not terribly obfuscated, I admit.) > > ov=${(L)${${ov/on/OFF}/off/on}} > > BTW, that works only in 3.1.5-pws-something. Exercise for the reader: > What two characters, inserted twice, give the same effect in 3.0.5? :s, which makes me wonder why the ${param/pattern/replacement} construct was added at all. -- Sweth Chandramouli IS Coordinator, The George Washington University / (202) 994 - 8521 (V) / (202) 994 - 0458 (F) *