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

Re: Three questions about a completer



I realize my knowledge of how the completion system works in its internals
is too limited, I can't really interpret what's going on. I have simplified
the code to the one below (for now removing the fix for taking care of
$NUMERIC, to make sure it isn't a source of the problem):

This is my whole ~/.zshrc:

autoload -U compinit
compinit

zle -C list-comp menu-complete _generic
zle -C rev-list-comp reverse-menu-complete _generic

bindkey '\ee' list-comp
bindkey '\eE' rev-list-comp

_list-result() {
    print "state: " $compstate[insert]
    compadd -M 'l:|=* m:{[:lower:]}={[:upper:]}' -f $HOME/*
    compstate[list]=''
    compstate[insert]='menu'
}

zstyle ':completion:*list-comp::::' completer _list-result

If I type "print <alt-e>", I can see "state: menu" being printed once, and
further presses of "<alt-e>" does not redisplay it. So I assume the
possible matches is used by the menu-completion and not re-generated.
However, once I change direction with "<alt-E>", the message is printed
every time I press "<alt-E>". So it's like the completion system doesn't
recognize that list-comp and rev-list-comp are part of the same solution,
and _list-result is called to start the generation of matches again. And
since there's already an alternative on the command line, nothing else
matches.


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