From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6418 invoked from network); 14 Nov 2000 16:12:09 -0000 Received: from sunsite.dk (HELO sunsite.auc.dk) (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Nov 2000 16:12:09 -0000 Received: (qmail 10797 invoked by alias); 14 Nov 2000 16:12:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13165 Received: (qmail 10790 invoked from network); 14 Nov 2000 16:12:26 -0000 From: "Bart Schaefer" Message-Id: <1001114161026.ZM22850@candle.brasslantern.com> Date: Tue, 14 Nov 2000 16:10:25 +0000 In-Reply-To: <20001114134703.D6034@sen.olsen.ch> Comments: In reply to Paul Johnson "PATCH: zsh and perl" (Nov 14, 1:47pm) References: <20001114134703.D6034@sen.olsen.ch> X-Mailer: Z-Mail (5.0.0 30July97) To: Paul Johnson , zsh-workers@sunsite.auc.dk Subject: Re: PATCH: zsh and perl Cc: adam@spiers.net MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 14, 1:47pm, Paul Johnson wrote: } } 1. cd was used which called my cd function I can see where this would be annoying, but somebody else could just as easily have a function for chdir. A somewhat better fix would be to use `builtin cd', but even that is going to call peoples' chpwd functions. } 2. with multiple versions of perl around it's nice to complete modules } specific to the version of perldoc being used Everything about this change looks OK except the call to _store_cache, which I don't think should have the ${(P)...} in the second argument. Just $perl_modules is needed. An improvement would be for the first argument to both _retrieve_cache and _store_cache to be ${perl_modules#_}, to continue using the same cache name as the previous version of the function. This patch goes on top of Paul's; I'll commit the end result soon. Any suggestions for how to avoid the chpwd problem? --- ../current/Completion/User/_perl_modules Tue Nov 14 08:02:44 2000 +++ Completion/User/_perl_modules Tue Nov 14 08:04:47 2000 @@ -42,7 +42,7 @@ fi if ( [[ ${(P)+perl_modules} -eq 0 ]] || _cache_invalid $perl_modules ) && - ! _retrieve_cache $perl_modules; + ! _retrieve_cache ${perl_modules#_}; then if zstyle -t ":completion:${curcontext}:modules" try-to-use-pminst && (( ${+commands[pminst]} )); @@ -71,9 +71,9 @@ # Find all modules if [[ -d $libdir && -x $libdir ]]; then - chdir $libdir + builtin cd $libdir new_pms=( {[A-Z]*/***/,}*.pm~*blib* ) - chdir $OLDPWD + builtin cd $OLDPWD fi # Convert to Perl nomenclature @@ -83,7 +83,7 @@ done fi - _store_cache $perl_modules ${(P)perl_modules} + _store_cache ${perl_modules#_} $perl_modules fi local expl -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net