From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7252 invoked from network); 14 Mar 2001 16:57:09 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Mar 2001 16:57:09 -0000 Received: (qmail 8404 invoked by alias); 14 Mar 2001 16:56:51 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3671 Received: (qmail 8393 invoked from network); 14 Mar 2001 16:56:50 -0000 Message-ID: To: zsh-users@sunsite.dk (Zsh users list), John Cooper Subject: Re: Completing within colon separated paths In-Reply-To: Your message of "14 Mar 2001 16:30:07 GMT." Date: Wed, 14 Mar 2001 16:56:22 +0000 From: Peter Stephenson Peter Stephenson writes: > OK, thanks for the explanation, and it works for me too when doing an > assignment. But I do also sometimes want it to perform completion correctly > when completing a colon separated path on a cmd line (e.g., the -classpath > argument to java or jview). Any way to force the same behavior in this > situation? The completion function that does this is called _value in the Base subdirectory, but it's written on the assumption that you have a real parameter whose value you are altering. The bit you're interested in is the stuff with compset -P '*:' # strip stuff up to last : compset -S ':*' # strip stuff after next colon _default -r '\-\n\t /:' "$@" # do default completion on this # -r is passed to compadd, see zshcompwid You probably want to decant that into another function and use _arguments to call this where you need it. In fact, in this particular case I rather think you need the tweak to _java in the patch at the bottom. > I've just noticed that using `setopt completeinword' seems to allow me to > complete using TAB rather than expand-or-complete-prefix. Yes, I'd forgotten I didn't have that set. Index: Completion/User/_java =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/User/_java,v retrieving revision 1.3 diff -u -r1.3 _java --- Completion/User/_java 2001/01/15 09:11:33 1.3 +++ Completion/User/_java 2001/03/14 16:55:16 @@ -368,6 +368,7 @@ classpath|sourcepath|bootstrapclasspath|docletpath) compset -P '*:' + compset -S ':*' _alternative \ "classpath:$state:_path_files -qS: -g '*.(jar|zip)'" \ "classpath:$state:_path_files -r': ' -/" -- Peter Stephenson Software Engineer CSR Ltd., Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070