Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
problem with quoting in completion function
- X-seq: zsh-workers 16976
- From: Borsenkow Andrej <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: problem with quoting in completion function
- Date: 14 Apr 2002 00:16:15 +0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
This applies to 4.0.4 as distributed by Mandrake.
I spent some time trying to understand why the following (suggested by
Sven) does not work:
compset -P "*,"
all_sources=( ${all_sources:#(${~IPREFIX//,/|})} )
The intention being to remove already present matches (separated by
comma) from list of possible matches.
It turned out, completion internally quotes IPREFIX, and in my case it
had spaces inside (like "Installation CD") so pattern never matched.
I.e. it tried to match
Installation\ CD
against
Installation CD
If this quoting is intentional it does not seem to be described in
documentation. But I still do not like it, it comes unexpected enough.
It makes it impossible to simply compare strings.
I had to finally do
compset -P "*,"
for i in ${(s:,:)IPREFIX}; do
eval "all_sources=( \${all_sources:#$i} )"
done
but that is just ugly.
-andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author