zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Paul Johnson <paulj@olsen.ch>, zsh-workers@sunsite.auc.dk
Cc: adam@spiers.net
Subject: Re: PATCH: zsh and perl
Date: Tue, 14 Nov 2000 16:10:25 +0000	[thread overview]
Message-ID: <1001114161026.ZM22850@candle.brasslantern.com> (raw)
In-Reply-To: <20001114134703.D6034@sen.olsen.ch>

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   


  reply	other threads:[~2000-11-14 16:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-14 12:47 Paul Johnson
2000-11-14 16:10 ` Bart Schaefer [this message]
2000-11-15 10:56 Sven Wischnowsky
2000-11-15 16:03 ` Bart Schaefer
2000-11-16 12:18   ` Adam Spiers

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=1001114161026.ZM22850@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=adam@spiers.net \
    --cc=paulj@olsen.ch \
    --cc=zsh-workers@sunsite.auc.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).