From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 451 invoked from network); 25 Jul 2004 21:37:23 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 25 Jul 2004 21:37:23 -0000 Received: (qmail 21501 invoked from network); 25 Jul 2004 21:37:17 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Jul 2004 21:37:17 -0000 Received: (qmail 26825 invoked by alias); 25 Jul 2004 21:37:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20195 Received: (qmail 26814 invoked from network); 25 Jul 2004 21:37:05 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 25 Jul 2004 21:37:05 -0000 Received: (qmail 20706 invoked from network); 25 Jul 2004 21:35:07 -0000 Received: from main.gmane.org (80.91.224.249) by a.mx.sunsite.dk with SMTP; 25 Jul 2004 21:35:06 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Boqe9-0003CM-00 for ; Sun, 25 Jul 2004 23:35:05 +0200 Received: from h-67-100-126-214.sttnwaho.dynamic.covad.net ([67.100.126.214]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Jul 2004 23:35:05 +0200 Received: from oberyno by h-67-100-126-214.sttnwaho.dynamic.covad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Jul 2004 23:35:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@sunsite.dk From: chris s Subject: Re: starting completions with =,<,> Date: Sun, 25 Jul 2004 14:39:38 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: h-67-100-126-214.sttnwaho.dynamic.covad.net User-Agent: Pan/0.14.2.91 (As She Crawled Across the Table) Sender: news X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-4.8 required=6.0 tests=BAYES_00,RCVD_IN_NJABL autolearn=no version=2.63 X-Spam-Hits: -4.8 On Sun, 25 Jul 2004 10:42:38 -0700, Bart Schaefer wrote: > Unless you "unsetopt equals" this could potentially be expanded into > > emerge -p /usr/local/bin/zsh-4.2.0-r1 > > (or the like). That's why there's the "-equals-" completion context. Yes, I saw that, it's in my example under the compdef header. Is it -equal- or -equals- though? And are there any examples of this anywhere? I saw that _bzip2 uses -redirect-, but it wasn't obvious how to apply that to my situation with -equal-. There doesn't seem to be any command that does use -equal-, that I've found. >> I saw in the manpage that _values does not support the equal sign. > > Can you quote the bits of the manual that made you think this? > > Sure, the man page for zshcompsys says this under _values 6th paragraph All other arguments describe the possible values and their arguments in the same format used for the description of options by the _arguments function (see above). The only differences are that no minus or plus sign is required at the beginning, values can have only one argument, and the forms of action beginning with an equal sign are not supported. I'm probably reading it wrong, though. > In any event I don't think you want _values. The _values function is > for words of the form where defaults to "=", > e.g. "foo=bar" (like an assignment). You can tell it to use a different > , but in the case of emerge there doesn't appear to be a > part. Exactly, there is no , just a . > The problem here is that you're trying to treat this as an option, when > what you need to do is treat it as an argument. The question is whether > it is a stand-alone argument, or whether it's an argument that must > follow the -p option? I haven't been able to dig up any documentation > on emerge (the only software I can find are a mass-mailing program and > the emacs CVS interface -- everything else is lost in the Google noise > because "emerge" is a real word). Sorry for not being more clear. Emerge is the gentoo linux install command. You can find out more about gentoo at www.gentoo.org. There is a manpage here: http://re.a.la/man/emerge/ What I am trying to add is listed under the ebuild and dependency headers. This could be a standalone argument, or it could follow one or more other arguments (-p, --pretend, --update, etc...). emerge -p =gvim-6.3 emerge =gvim-6.3 emerge --pretend --deep --buildpkg =gvim-6.3 All valid commands as far as emerge is concerned. The existing emerge completion is here: http://cpan.cybercomm.nl/pub/gentoo-portage/app-shells/zsh/files/_portage If I insert this snippet (along with the _portage_ebuilds from my previous example) into the above completion, --pretend works and lists all the appropriate files, while = lists the normal ones. =|--pretend) _arguments -s \ '*:install version:_portage_ebuilds' "$common_args[@]" && return 0 ;; And just to clarify, I want regular emerge without an equal sign to complete one list (fvwm, zsh, abiword...) and the emerge = to complete exact versions (fvwm-2.5.10-r6, fvwm-2.4.18, zsh-4.2.0-r1, ...). So I can't just replace the default behavior with the versioned packages. Hope that clears things up. Thanks for looking at this.