From: Peter Stephenson <pws@csr.com>
To: zsh-users@sunsite.dk (Zsh users list),
John Cooper <john.cooper@eu.citrix.com>
Subject: Re: Completing within colon separated paths
Date: Wed, 14 Mar 2001 16:56:22 +0000 [thread overview]
Message-ID: <Tc0a88d01524a813608@mailsweeper01.cambridgesiliconradio.com> (raw)
In-Reply-To: Your message of "14 Mar 2001 16:30:07 GMT." <m3bsr4ia9c.fsf@kontiki.cam.eu.citrix.com>
Peter Stephenson <pws@csr.com> 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 <pws@csr.com> Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070
prev parent reply other threads:[~2001-03-14 16:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-14 15:45 John Cooper
2001-03-14 15:53 ` Peter Stephenson
2001-03-14 16:30 ` John Cooper
2001-03-14 16:56 ` Peter Stephenson [this message]
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=Tc0a88d01524a813608@mailsweeper01.cambridgesiliconradio.com \
--to=pws@csr.com \
--cc=john.cooper@eu.citrix.com \
--cc=zsh-users@sunsite.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).