zsh-workers
 help / color / mirror / code / Atom feed
From: "D. Ben Knoble" <ben.knoble@gmail.com>
To: zsh-workers@zsh.org
Subject: bug: _files depends on extendedglob
Date: Fri, 29 Mar 2024 11:50:58 -0400	[thread overview]
Message-ID: <CALnO6CByDs7UuFCx_oYKh92Nt+AzTZB=HiQ1FEjkY24ci+v4tQ@mail.gmail.com> (raw)

Here's a transcript from a session after I finally pieced together
what was breaking in
https://github.com/benknoble/Dotfiles/commit/9c7dd6d1ec8b3caac670f1a2a030769a4c90c06c,
which contains in its message more details about how I debugged this
particular failure.

zsh --version
zsh 5.9 (x86_64-apple-darwin20.6.0)
# macOS 12.7.2
zsh -f
temp=$(mktemp -d)
fpath+=($temp)
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh
-o $temp/_git
autoload -Uz compinit && compinit
_git_doc () { emulate -L zsh
  _files -W $(git --html-path)/
}
git doc <TAB>
# (eval):1: no matches found: *:globbed-files
# completion results still produced
_git_doc () { emulate -L zsh
  setopt extendedglob
  _files -W $(git --html-path)/
}
git doc <TAB>
# works like a charm

I'm not sure what the appropriate fix is, though I think some
combination of localopts and extendedglob might work? I see that some
parts of _files test for extendedglob, but the part that sets pats
that leads to the failure (line 78 for me) seems to be affected
without any test.

-- 
D. Ben Knoble


             reply	other threads:[~2024-03-29 15:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29 15:50 D. Ben Knoble [this message]
2024-03-29 17:23 ` Mikael Magnusson
2024-03-29 17:44   ` Ben Knoble
2024-03-29 19:40     ` Bart Schaefer
2024-03-29 19:43     ` Oliver Kiddle
2024-03-30 15:27       ` D. Ben Knoble
2024-03-30 15:46         ` 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='CALnO6CByDs7UuFCx_oYKh92Nt+AzTZB=HiQ1FEjkY24ci+v4tQ@mail.gmail.com' \
    --to=ben.knoble@gmail.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).