zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Completion error message
Date: Sun, 28 Jan 2018 22:16:38 +0100	[thread overview]
Message-ID: <1360.1517174198@thecus.kiddle.eu> (raw)
In-Reply-To: <CAH+w=7YaRQAgdHzUE-YF+XZoLobiT=gynoY9imuUYriytPYMhQ@mail.gmail.com>

Bart wrote:
> You only get the "no match for: ..." text if you have set the
> appropriate zstyle.

It also implies that a tag loop was run for particular tags even if
there were no matches.

> How about this?
>
> BartMAC2014% zstyle ':completion:*:messages' format %S%d%s
> BartMAC2014% rsync -4 -6 --
> no valid completions

If this is useful, then it might as well be done at the top-level in
_main_complete, perhaps controlled by a format style. Any function can
produce no matches and not even run through a tag loop–it isn't unique
to _arguments.

There's a variety of different conditions that cause comparguments -i to
return 1 besides all sets being disabled. For a very simple example,
take an arguments spec consisting of just options with no rest arguments,
e.g: _foo() { _arguments -a }, then try completion following a
non-option argument, e.g. foo arg <tab>
If _arguments is used in conjunction with another function (uncommon but
there are uses), the message would be unwanted. Only generating it from
_main_complete allows you to be sure there were no matches at all.

Oliver


  reply	other threads:[~2018-01-28 21:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 15:50 Daniel Shahaf
2018-01-25 20:24 ` Oliver Kiddle
2018-01-26  7:21   ` Mikael Magnusson
2018-01-28  2:16     ` Bart Schaefer
2018-01-28 21:16       ` Oliver Kiddle [this message]
2018-01-25 20:35 ` 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=1360.1517174198@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --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).