From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: zsh and perl
Date: Wed, 15 Nov 2000 16:03:57 +0000 [thread overview]
Message-ID: <1001115160357.ZM4881@candle.brasslantern.com> (raw)
In-Reply-To: <200011151056.LAA05515@beta.informatik.hu-berlin.de>
On Nov 15, 11:56am, Sven Wischnowsky wrote:
}
} I'm sure I'm missing something, but... why not just avoid the cd
} altogether? Something like
}
} new_pms=( $libdir/{[a-Z]*/***/,}*.pm~*blib* )
} new_pms=( "${(@)new_pms#$libdir/}" )
I wondered about that myself.
} probably testing if $libdir is non-empty before that...
We already have reasonably confidence that $libdir is non-empty because it
came either from perl's @INC array or from a previous glob which it's then
iterating over with `for'. It also tests [[ -d $libdir && -x $libdir ]],
so I can't think of any reason for doing the cd.
(Does this recursive glob with *** potentially have the same automounting
problem that we hacked around in _path_files?)
I used $libdir/## for the pattern removed from each word, just in case
$libdir already had a trailing slash before we added another one. The
other change is just in case `.' is not the last element of @INC, for
whatever odd reason. It might make more sense to avoid the recursive
glob for `.', rather than skip it entirely.
Index: Completion/User/_perl_modules
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.1/Completion/User/_perl_modules,v
retrieving revision 1.14
diff -u -r1.14 _perl_modules
--- _perl_modules 2000/11/15 15:39:37 1.14
+++ _perl_modules 2000/11/15 15:44:11
@@ -67,13 +67,12 @@
for libdir in $inc; do
# Ignore cwd - could be too expensive e.g. if we're near /
- if [[ $libdir == '.' ]]; then break; fi
+ if [[ $libdir == '.' ]]; then continue; fi
# Find all modules
if [[ -d $libdir && -x $libdir ]]; then
- builtin cd $libdir
- new_pms=( {[A-Z]*/***/,}*.pm~*blib* )
- builtin cd $OLDPWD
+ new_pms=( $libdir/{[A-Z]*/***/,}*.pm~*blib* )
+ new_pms=( "${(@)new_pms#$libdir/##}" )
fi
# Convert to Perl nomenclature
--
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
next prev parent reply other threads:[~2000-11-15 16:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-15 10:56 Sven Wischnowsky
2000-11-15 16:03 ` Bart Schaefer [this message]
2000-11-16 12:18 ` Adam Spiers
-- strict thread matches above, loose matches on Subject: below --
2000-11-14 12:47 Paul Johnson
2000-11-14 16:10 ` Bart Schaefer
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=1001115160357.ZM4881@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--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).