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

Re: Proposal: Let compinit make standard widgets with _generic instead of _main_complete



On Sun, May 9, 2021 at 1:51 PM Lawrence Velázquez <larryv@xxxxxxx> wrote:
>
> Anything else on this?

Attempting to summarize the conclusions (so far):

There's no backward-compatible change that can be made to the widget
definitions.

_generic was not meant to be used to re-implement the default widgets;
the expected approach is to create a custom widget with a different
name.

It's possible to achieve the desired effect by using "zstyle -e" to
examine $WIDGET.  An example appeared in another thread:
  zstyle -e ':completion::*:default' menu \
    '[[ $WIDGET = (|reverse-)menu-complete ]] &&
    reply=(yes select interactive)'

I think it's therefore safe to say that we're not going to apply
either of the patches that have appeared earlier in this thread.

On a bit of further reflection, I think there's an even simpler
formulation that should give the same effect (excuse possible gmail
line wrap):
  zstyle -e ':completion::*:default' menu \
   'zstyle -a ":completion:${WIDGET}:${curcontext#*:}:default" menu reply'

That avoids the issue mentioned in workers/48397 wherein _generic
changes the call tree inside _complete_debug, but to completely mask
the effect one would have to use ${WIDGET#_complete_(debug|help)} or
similar.




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