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

problem with _expand (I think)

Here's something strange where a global alias of mine seems to be
skipped by _expand in certain circumstances.  To duplicate this,
start with "zsh -f" and enter these commands:

    autoload -U compinit
    zstyle ':completion:*' completer _expand _complete
    bindkey '\t' complete-word
    alias -g ,f='|fgrep'

OK, that ensures that tab does not use expand-or-complete, which does
not exhibit the bug.  Note that I created a global alias that lets me
type ",f" instead of "|fgrep".  We also need a file named "some-file"
with the following lines in it:


Now let's try to use TAB to expand a back-tick expression:

    echo `fgrep some-file o ,f -v a`

That outputs "foo" when run, but the expansion gets "some-file:bar"
instead of "foo" if TAB is pressed.  This is apparently because the ",f"
was treated as a file, and the -v option was reordered in front of the
'o' (due to gnu's non-posix command-line parsing).

I tried this in 4.2.5 and 4.3.0-dev-5, and both fail to get this right.


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