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

Re: Completion oddities



Bart Schaefer wrote:
> Maybe I'm just confused.
>
> #1
> It appears that setting MENUSELECT globally, overrides the "no-select"
> string in the "menu" zstyle.  I would think it should be the other way
> around.

The menu selection was built to work even with compctl completion.
MENUSELECT is the interface _main_complete uses to control it. So the
way it is doesn't surprise me.

> #2
> When the "original" style is true for _approximate and _correct, the
> REC_EXACT option seems to be ignored.  Is there a way around that?

While you've since posted a solution, I've not managed to construct an
example to demonstrate the difference.

> #3
> According to _complete_debug output, this is the context _approximate
> is using for looking up a style when called from _correct_word (that
> is, as "_main_complete _correct"):
>     zstyle -t ":completion:correct-word:correct-1:::" original
> Appending the count to the completer is documented for _approximate
> but not mentioned in _correct.

The documentation does state under _correct that "It is based on
_approximate" so that can imply that some functionality is shared. That
does continue with "but the completer field in the context name is
correct." So perhaps it should be explicit about the change count also
being in that field.

> #4
> The way that the function field of a context is computed is a bit
> annoying.  For example, if I call
>     zle _correct_word
> from _generic, then instead of the widget name in the function slot,
> the function is correct-word.  This makes it impossible to specify
> styles for the widget separately from styles for using _correct_word
> directly. It's done this way by a large number of functions.
>

How are you calling `zle _correct_word` from _generic? In my testing,
this worked fine:
  zle -C corrupt-word complete-word _generic
  zstyle ':completion:corrupt-word:*' completer _complete_word
  bindkey '^Xz' corrupt-word
  zstyle ':completion:corrupt-word:*' ignored-patterns '*?.h'

Oliver




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