From: "Jesper Nygårds" <jesper.nygards@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Three questions about a completer
Date: Thu, 15 Sep 2016 08:01:02 +0200 [thread overview]
Message-ID: <CABZhJg8kwLFFkA5NR=Eq4NCCUf7=7rvypBow0izji3JdQiBtDg@mail.gmail.com> (raw)
In-Reply-To: <CABZhJg9RR-8kJpfoiBn=0GpjK2fVWNk-Zuz09=CBkbB=AdEnaQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]
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.
prev parent reply other threads:[~2016-09-15 6:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-12 11:38 Jesper Nygårds
2016-09-12 20:53 ` Oliver Kiddle
2016-09-13 16:16 ` Jesper Nygårds
2016-09-13 19:18 ` Jesper Nygårds
2016-09-14 2:59 ` Bart Schaefer
2016-09-14 7:22 ` Jesper Nygårds
2016-09-14 16:39 ` Bart Schaefer
2016-09-14 20:32 ` Jesper Nygårds
2016-09-15 4:49 ` Bart Schaefer
2016-09-15 6:01 ` Jesper Nygårds [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABZhJg8kwLFFkA5NR=Eq4NCCUf7=7rvypBow0izji3JdQiBtDg@mail.gmail.com' \
--to=jesper.nygards@gmail.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).