zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Pier Paolo Grassi <pierpaolog@gmail.com>
Cc: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>,
	Zsh-Users List <zsh-users@zsh.org>
Subject: Re: menu completion
Date: Sat, 23 May 2020 12:21:23 -0700	[thread overview]
Message-ID: <CAH+w=7Y56u9-bZmS0sCaMNOU12Tp4r=b9_WEv5Z6E+ymJcYCDQ@mail.gmail.com> (raw)
In-Reply-To: <CAP+y1xDxK+6YHV3foF+yE6qBzdCiY33w=JHfakTPxbRatPmV1Q@mail.gmail.com>

On Sat, May 23, 2020 at 3:53 AM Pier Paolo Grassi <pierpaolog@gmail.com> wrote:
>
> Basically I wonder if it is up to the completer to choose whether to do
> interactive menu completion, any thoughts on this?

That's not precisely what's happening.

The completer is deciding that you should see the message "pattern"
because the guard says there are no valid options beginning with a
single hyphen.  (Literally it means anything not beginning with two
hypens must be a pattern, and it doesn't know how to complete
patterns, but the effect is the same.)  It's the setup to display that
message that turns off the menu, because you can't both have a menu
and see the message.

But the guard is wrong -- there actually ARE some options
(non-patterns) that begin with a single hyphen.  So the completer
proceeds to add all the possible matching options, and when control
returns to the top level (_main_complete), it sees the set of
completions is not empty and therefore offers those instead of the
message.

It's possible this should be considered a problem with _message --
that is, that once _message has been called, completion should STOP
and force the message to be seen, instead of continuing to try other
possible variations.  Then instead of

zsh: do you wish to see all 156 possibilities (41 lines)?

you would see (assuming you defined the "format" zstyle) e.g.

completing pattern

(and perhaps get a beep) which is actually what was intended by the guard.

However, I suspect stopping after every _message might break other
valid use cases.

  reply	other threads:[~2020-05-23 19:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05 12:00 Pier Paolo Grassi
2020-04-05 16:48 ` Dave Woodfall
2020-04-05 19:29 ` Mikael Magnusson
2020-04-06  2:18   ` Pier Paolo Grassi
2020-05-07 18:55     ` Jun. T
2020-05-09 18:23       ` Pier Paolo Grassi
2020-05-12  0:39         ` Jun T
2020-05-20 18:16           ` Pier Paolo Grassi
2020-05-22 15:34             ` Jun. T
2020-05-22 16:12               ` Pier Paolo Grassi
2020-05-22 18:36                 ` Jun. T
2020-05-23 10:51                   ` Pier Paolo Grassi
2020-05-23 19:21                     ` Bart Schaefer [this message]
2020-05-23 19:40                       ` Bart Schaefer

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=7Y56u9-bZmS0sCaMNOU12Tp4r=b9_WEv5Z6E+ymJcYCDQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=pierpaolog@gmail.com \
    --cc=takimoto-j@kba.biglobe.ne.jp \
    --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).