zsh-workers
 help / color / mirror / code / Atom feed
* problem with quoting in completion function
@ 2002-04-13 20:16 Borsenkow Andrej
  2002-04-13 20:23 ` Borsenkow Andrej
  2002-04-16  7:59 ` Sven Wischnowsky
  0 siblings, 2 replies; 4+ messages in thread
From: Borsenkow Andrej @ 2002-04-13 20:16 UTC (permalink / raw)
  To: Zsh hackers list


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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-04-16  8:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-13 20:16 problem with quoting in completion function Borsenkow Andrej
2002-04-13 20:23 ` Borsenkow Andrej
2002-04-14  5:03   ` Bart Schaefer
2002-04-16  7:59 ` Sven Wischnowsky

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).