zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Proposal: Let compinit make standard widgets with _generic instead of _main_complete
Date: Mon, 10 May 2021 10:11:42 -0700	[thread overview]
Message-ID: <CAH+w=7ZWkbFzMgVheMd3hoPS+TDgwR-FQCgABxjmGGuQXJ8A7Q@mail.gmail.com> (raw)
In-Reply-To: <d37e61ba-fb5a-4cfc-b21d-34b40e898341@www.fastmail.com>

On Sun, May 9, 2021 at 1:51 PM Lawrence Velázquez <larryv@zsh.org> 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.


      reply	other threads:[~2021-05-10 17:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 22:23 Marlon Richert
2021-03-20 18:09 ` Bart Schaefer
2021-03-20 23:52   ` Bart Schaefer
2021-03-21 15:19     ` Marlon Richert
2021-03-22  1:46       ` Bart Schaefer
2021-03-22  7:16         ` Marlon Richert
2021-04-03 19:37           ` Lawrence Velázquez
2021-04-04 18:35           ` Bart Schaefer
2021-04-04 19:31             ` Bart Schaefer
2021-04-09 19:11             ` Oliver Kiddle
2021-04-09 19:35               ` Bart Schaefer
2021-05-09 20:51                 ` Lawrence Velázquez
2021-05-10 17:11                   ` Bart Schaefer [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='CAH+w=7ZWkbFzMgVheMd3hoPS+TDgwR-FQCgABxjmGGuQXJ8A7Q@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@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).