From: Bart Schaefer <schaefer@brasslantern.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: completion within a function
Date: Tue, 5 Jan 2021 11:57:13 -0800 [thread overview]
Message-ID: <CAH+w=7ZVr5iMNtJoLB2Xcf+u4hcOwQ2w_JXCtZLqi-pKrR6ZhQ@mail.gmail.com> (raw)
In-Reply-To: <CAMP44s0yan_xueZgCbWaiGvB-XwfaihovcA43W0d-4Aurnx=dg@mail.gmail.com>
On Sun, Jan 3, 2021 at 3:16 PM Felipe Contreras
<felipe.contreras@gmail.com> wrote:
>
> [...] your version seems to take longer to load, slowing the tests.
I don't know what your version is loading or whether a .zcompdump file
might be getting used to speed that part up. When I try it (with the
zsh-dist-provided git completions) it spends more of its time
populating git data than anything else.
> [...] it still doesn't work correctly: I can't pass empty arguments
> in the middle of a command-line.
What does an empty argument in the middle of the line mean to the
completion result? Which word are you trying to complete?
I thought you were passing a single string as the only argument to my
"complete" function? If that's true, how is the empty argument
represented in that string?
> Also, I don't understand why is there an argv there:
>
> vared -M __complete -i __init_complete ${${argv:+argv}:-reply}
> (( ARGC )) || print -nrl -- "~~~${(@)reply}~~~"
>
> Isn't "reply" always used? And ARGC is always 0?
The ARGC/argv stuff is there so that you can call run-complete directly:
% run-complete "git checkout -- "
which only works from an interactive command line, and just prints the
completion without forking off a zpty.
Called as the zpty command from complete, yes, ARGC is always zero and
reply is used.
next prev parent reply other threads:[~2021-01-05 19:58 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-29 15:24 Ray Andrews
2020-12-29 18:52 ` Bart Schaefer
2020-12-29 19:36 ` Felipe Contreras
2020-12-29 19:41 ` Roman Perepelitsa
2020-12-29 21:04 ` Ray Andrews
2020-12-29 21:21 ` Ray Andrews
2020-12-29 22:03 ` Bart Schaefer
2020-12-29 21:48 ` Bart Schaefer
2020-12-30 0:31 ` Ray Andrews
2020-12-30 4:34 ` Roman Perepelitsa
2020-12-30 16:45 ` Ray Andrews
2020-12-30 17:21 ` Felipe Contreras
2020-12-30 20:43 ` Bart Schaefer
2020-12-30 20:46 ` Bart Schaefer
2020-12-30 20:50 ` Ray Andrews
2020-12-30 21:31 ` Roman Perepelitsa
2020-12-30 22:05 ` Bart Schaefer
2020-12-30 22:18 ` Felipe Contreras
2020-12-30 23:47 ` Bart Schaefer
2020-12-31 0:08 ` Bart Schaefer
2020-12-31 0:12 ` Felipe Contreras
2020-12-31 0:30 ` Bart Schaefer
2020-12-31 0:39 ` Bart Schaefer
2020-12-31 1:04 ` Felipe Contreras
2020-12-31 21:25 ` Bart Schaefer
2021-01-01 0:12 ` Ray Andrews
2021-01-02 0:27 ` Bart Schaefer
2021-01-02 22:24 ` Bart Schaefer
2021-01-03 0:28 ` Felipe Contreras
2021-01-03 0:53 ` Bart Schaefer
2021-01-03 1:20 ` Felipe Contreras
2021-01-03 2:21 ` Bart Schaefer
2021-01-03 2:47 ` Felipe Contreras
2021-01-03 3:30 ` Bart Schaefer
2021-01-03 23:16 ` Felipe Contreras
2021-01-05 19:57 ` Bart Schaefer [this message]
2021-01-03 17:50 ` Bart Schaefer
2021-01-03 0:07 ` Felipe Contreras
2020-12-31 1:03 ` Felipe Contreras
2020-12-30 6:45 ` 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=7ZVr5iMNtJoLB2Xcf+u4hcOwQ2w_JXCtZLqi-pKrR6ZhQ@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=felipe.contreras@gmail.com \
--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).