From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25068 invoked from network); 13 Mar 2000 17:10:39 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Mar 2000 17:10:39 -0000 Received: (qmail 8838 invoked by alias); 13 Mar 2000 17:10:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10123 Received: (qmail 8829 invoked from network); 13 Mar 2000 17:10:33 -0000 Date: Mon, 13 Mar 2000 17:10:31 +0000 From: Adam Spiers To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: completion for perl Message-ID: <20000313171031.A2532@thelonious.new.ox.ac.uk> Reply-To: Adam Spiers Mail-Followup-To: zsh-workers@sunsite.auc.dk References: <200003131057.LAA17005@beta.informatik.hu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <200003131057.LAA17005@beta.informatik.hu-berlin.de>; from wischnow@informatik.hu-berlin.de on Mon, Mar 13, 2000 at 11:57:05AM +0100 X-Home-Page: http://www.new.ox.ac.uk/~adam/ X-OS: Linux 2.2.12 i686 Sven Wischnowsky (wischnow@informatik.hu-berlin.de) wrote: > > Adam Spiers wrote: > > > Whilst struggling with the mess which is _perl_config_vars below, it > > struck me how an equivalent of compset -P which matched the /whole/ of > > PREFIX rather than just the beginning would have come in handy. > > Err... `compset -P "*"' does that, but it leaves you with an empty > $PREFIX, of course, which is probably not what one wants. Sorry; I didn't explain myself clearly at all. I would like to be able to do a compset -P type of operation using a pattern which is anchored to both the start /and/ end of PREFIX, rather than just the start, which is what currently always happens. Then again, I suppose this can be implemented easily manually, e.g.: if [[ "$PREFIX" == *: ]]; then IPREFIX="$IPREFIX$PREFIX" PREFIX='' fi > > Also, as you can see from the compstate[quoting] line below, I > > tried to get completion working for > > > > $ perl -V:' > > > > and > > > > $ perl -V:" > > > > so that it would insert a single space after each configuration > > variable completed while within quotes, rather than a quoted single > > space, but I didn't fully understand how compset -q works, and > > couldn't stop it from eating up the opening quote. Help! :-) > > The problem is that we check the quoting stuff at the very beginning > of the completion code -- and detect only quotes at the beginning of > the word. So what we could get to work is completion of > > $ perl '-V: > > but not with the quote after the colon. That's done with first calling > `compset -q', then the `compset -P'. Getting quotes in words to work > is to hard to make me try it (all kinds of nasty interactions with the > lexer). But maybe calling first `compset -P' and then `compset -q' > should have the same effect as the other way round... I currently > don't remember why it behaves the way it does. So is there currently no solution? I tried using things like compset -P '*"' but they never matched, presumably because of the lexer interactions you mention.