Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion in quotes - " vs ' - no suffix added
- X-seq: zsh-workers 17086
- From: Sven Wischnowsky <wischnow@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: completion in quotes - " vs ' - no suffix added
- Date: Wed, 8 May 2002 09:37:05 +0200
- In-reply-to: <1020506153137.ZM6413@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <6134254DE87BD411908B00A0C99B044F035BB41F@xxxxxxxxxxxxxxxxxxxxxxx> <1020506153137.ZM6413@xxxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
> ...
>
> Hmm. It's slightly worse than that ...
>
> schaefer<510> functions _foo
> _foo () {
> local suf="/ \t\n"
> [[ -n $compstate[quote] ]] && { suf="$compstate[quote]$suf"
> compset -q }
> _files -r $suf
> }
> schaefer<511> compdef _foo foo
> schaefer<512> ls
> don't stop/ rmthat/
> schaefer<514> foo '<TAB>
> Completing file
> don\'\''t\ stop rmthat/
> schaefer<514> foo "<TAB>
> Completing file
> don\\'t\\ stop rmthat/
>
> Wrong number of backslashes in both cases; that's why the trailing suffix
> didn't get added. This looks similar to the problem we had with _values,
> that Sven patched in 16998.
No, it doesn't: there's nothing wrong, as far as I can see. Always
remember, what `compset -q' is intended for, namely things like:
zsh -c 'echo do<TAB>
Try it and you'll see that it does the right thing. At least it does
for me.
What Andrej probably wants is splitting the current string with a
combination of `compset -[PS]' and the ${(z)...} parameter flag. I'd
like to know how that command is then able to find the different
sub-words in the quoted string if things like spaces are not quoted a
second time.
Or am I missing something?
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author