zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Johan Grande <nahoj@crans.org>
Cc: zsh-workers@zsh.org
Subject: Re: _files -g <pattern> offers files that don't match the pattern and conversely
Date: Sat, 15 Jul 2023 14:28:54 -0700	[thread overview]
Message-ID: <CAH+w=7a9GO9Wu=HSYWVRyjerN7=DvV-61FpqYKaPgL9jd-=AOg@mail.gmail.com> (raw)
In-Reply-To: <30192b9e-b6a8-e19f-efb5-5af0fb710951@crans.org>

On Sat, Jul 15, 2023 at 9:51 AM Johan Grande <nahoj@crans.org> wrote:
>
> Le 15/07/2023 à 18:16, Bart Schaefer a écrit :
> > On Sat, Jul 15, 2023 at 6:32 AM Johan Grande <nahoj@crans.org> wrote:
> >>
> >> % _f() { _files -g 'c(.)' }; compdef _f f
> >> % f <tab>
> >> a  b       # even though 'a' and 'b' don't match the pattern
> >
> > The only way I can make this happen is if "a" and "b" are directories.
> > _files will complete local directory names if there are no matching
> > files.
>
> In my test they are regular files

Hmm.  OK, I can now reproduce this with both 5.8 and 5.9 _files but
only if there are no local directories either (e.g., with "a" "b" and
"d/" I get "d" only).

So the real reason here is that _files always tries the "directories"
and "all-files" tags if "globbed-files" doesn't find anything.
_path_files does not use the same tags list.


      reply	other threads:[~2023-07-15 21:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-15 13:31 Johan Grande
2023-07-15 13:34 ` Johan Grande
2023-07-15 16:16 ` Bart Schaefer
2023-07-15 16:51   ` Johan Grande
2023-07-15 21:28     ` 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=7a9GO9Wu=HSYWVRyjerN7=DvV-61FpqYKaPgL9jd-=AOg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=nahoj@crans.org \
    --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).