Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: expansion of environment variables



[>workers]

On Mar 5,  5:46pm, Peter Stephenson wrote:
}
} You're right, I missed that last step, there is indeed stuff in tmp1
} including the correct completion.

I've been staring at this and I've concluded (possibly wrongly) that
even the stuff in tmp1 is a bit of a red herring.

Correct me, but isn't the real problem that the string on the line
still looks like "$key." but all of the possible matches look like
"2345.xml"?  The literal string "$key" is not going to match the
literal string "2345" no matter what we do with prefixes, and the
-U option (if it helps at all) is merely going to overwrite "$key."
with "2345." which is exactly the behavior we were asked how avoid
in the first place.

This may be a case where the factoring of the old internals into the
set of comp* builtins has resulted in a loss of information.  We can
figure out that [[ 2345.xml = $key.* ]] but it's a lot harder to
figure out based on that, that "$key.xml" is what needs to be fed
into compadd instead of "2345.xml".

What we need is something that recurses along the strings the way
that the internals of matchers do, but that knows about parameter
replacements instead of (or as well as) matching classes.

-- 



Messages sorted by: Reverse Date, Date, Thread, Author