zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Bart Schaefer <schaefer@brasslantern.com>,
	"zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [Bug] Doubled completions with suffix aliases and grouping
Date: Mon, 6 Jul 2020 21:51:06 -0700	[thread overview]
Message-ID: <CAH+w=7ZFUwYrguy6L5_N3NTGSiYPChgsFwmpFpmJ18-10+LX+A@mail.gmail.com> (raw)
In-Reply-To: <20200705192433.mdqsbcrhhasqvotf@aegis.localdomain>

On Sun, Jul 5, 2020 at 12:24 PM Guido Cella <guidocella91@gmail.com> wrote:
>
> I think that the bug is adding files that aren't executable to the
> "executable file" grouping.

Aye, well, that's not exactly a bug either.  The position taken when
developing the completion code was that it's always better to offer
something that the user might possibly mean rather than to offer
nothing; i.e., err on the side of too much information rather than too
little.  Because _command_names uses _alternative, the two branches
(executables and suffix-aliases) don't "know" that the other might
produce overlapping matches, so each generates its result
independently, and when executables finds nothing, it falls back to
all files.

There are two elements of your specific example that could potentially
be considered bugs.  The first is that there's no file-patterns zstyle
for the "executables" tag; the closest you can get is to set one for
the :completion:complete:-command-:: context.  The second is that this
doesn't work:

zstyle :completion::complete:-command-::executables ignored-patterns '*(^*)'

Instead you have to do this:

zstyle :completion::complete:-command-::executables ignored-patterns '*(#q^*)'

However, I think you'll find if you do that latter, you'll get what you want.

  reply	other threads:[~2020-07-07  4:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-05 17:46 Guido Cella
2020-07-05 18:09 ` Bart Schaefer
2020-07-05 19:24   ` Guido Cella
2020-07-07  4:51     ` Bart Schaefer [this message]
2020-07-07  6:57       ` Guido Cella
2020-07-07 17:20         ` Bart Schaefer
2020-07-07 17:59           ` Guido Cella

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=7ZFUwYrguy6L5_N3NTGSiYPChgsFwmpFpmJ18-10+LX+A@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).