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

Re: expansion of environment variables



On Mar 5,  4:54pm, Peter Stephenson wrote:
}
} > For benefit of zsh-workers, with compinit this is yet another problem
} > in _path_files.  At line 479 (latest CVS) it correctly assigns the
} > expanded list of files to the tmp2 array (having originally gotten
} > them from "compadd -D tmp1" at line 466), but then when building the
} > exppaths array at lines 484 or 486, it uses ${tpre}${tsuf} which have
} > never been expanded.
} 
} That's too late---it's failed at that point.  See the comment above that
} section.  We're in the code that triggers where compfiles (the builtin that
} handles the globbing) didn't produce any matches so $#tmp1 is empty.

Hmm, I misread something, but I think you did as well.

The call to "compfiles -p" at line 418 is what fills in tmp1.  It DOES
find matching files, because at line 466 we save tmp1 in tmp2 and at
that point tmp1 is the expanded list.  Then at 467 we call compadd -D
passing only the tails of what was expanded in commpfiles, and compadd
empties tmp1 again.

So I suspect this is more of the same foolishness that forced us to add
$Uopt a bit ago, but manifesting in a different way.  Or maybe we need
to pass some prefix options to compadd at that point?

} I suspect, by the way, that the original query was about the old builtin
} completion, not the function system.

Yes, I know.  I meant to say "the expand-word and complete-word builtin
widgets" in the first paragraph of my first reply, but thinko'd.



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