Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion within a function
- X-seq: zsh-users 26334
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: completion within a function
- Date: Tue, 5 Jan 2021 11:57:13 -0800
- Archived-at: <https://zsh.org/users/26334>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/CAH%2Bw%3D7ZVr5iMNtJoLB2Xcf%2Bu4hcOwQ2w_JXCtZLqi-pKrR6ZhQ%40mail.gmail.com>
- In-reply-to: <CAMP44s0yan_xueZgCbWaiGvB-XwfaihovcA43W0d-4Aurnx=dg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <c9416d92-29b1-68e5-e51e-d7152f1fbc4b@eastlink.ca> <CAH+w=7bT5GaGvWih=A8KCyUe4N6k25VxDLcpPA5C1yGn38Zimg@mail.gmail.com> <819ec6fe-5af2-2e97-c5bb-f434b1de86d7@eastlink.ca> <CAH+w=7bSbhdHGC89daK+8o0psLhdw969=GviC4s554t37_zrDw@mail.gmail.com> <520ce98a-4394-726d-3d12-8ef414e881c9@eastlink.ca> <CAN=4vMquijkmnETv2xUdnpGcJoQPaimXT1+i+daHoivLmpK+TA@mail.gmail.com> <f490bbd8-dc96-341d-e11b-a5d957c9268e@eastlink.ca> <CAMP44s13tqgmNgUcuAxUJyJ_LGjDSEE1FJ64k2r12UogbW0r0w@mail.gmail.com> <CAH+w=7a+9_jX8xkvKjCVhQWXQMqQkWvahHyzTj=Lm_DgC=o5kw@mail.gmail.com> <CAMP44s1KT0B-wGmEndZUW2xkh8t-mawKA3y5yaqAH3GjiEXuCA@mail.gmail.com> <CAH+w=7ZqpLfuoqdJ1yRRDR37DHLK5oOQP+878yaWA+M119QdhA@mail.gmail.com> <CAMP44s3qy8OToPuV9DH2fnU=eDYuZYFGmvoDUdmexdCYC_FpSg@mail.gmail.com> <CAH+w=7ZYcLH0DhnDMTGGKE1VFCVT15K0RFpDbQvZH_EvD1ywHg@mail.gmail.com> <CAH+w=7bL1RodoTiNQykLESwK5v3ppGYs_AG-bGcgPqnf-kC_Cw@mail.gmail.com> <CAMP44s3LE2ccjgB9mxjZNifUX0evDhgUSh9oWpNM3GDgM0DwVQ@mail.gmail.com> <CAH+w=7bnFjxfriMt-BVau66A3OZGUdKcbCDXX8G3pD_i=_+kTQ@mail.gmail.com> <CAH+w=7bZXGvVqeftVn4FnPd+G9Y5tm+YU6yV9wkgE1vXTEVLKw@mail.gmail.com> <CAH+w=7adMRpgA97=Y-m_U--HW0APgVH3Bq4Y3=Zjy9uoh_7fzg@mail.gmail.com> <CAMP44s1zOR_zCOYMi_eWGH6ygsm05CC1WNMtMFxZD_qZxejM7g@mail.gmail.com> <CAH+w=7ZTxt+XjXxi-xC2MbDL8E5w-G-WEC2NMZAAD39JaJvdEA@mail.gmail.com> <CAMP44s39S8Nw_e32hnVyaPxZn_ARVKzKM8SUMkK8Dsax4w4Syw@mail.gmail.com> <CAH+w=7bzQEUAg0wwP9rGrbauQ2iebWEZWgy1Jb44=GLtN7f84A@mail.gmail.com> <CAMP44s1f7LWrCpcuQhgAiDDUzrLse50S6cNLH4VXjidN=nAbMg@mail.gmail.com> <CAH+w=7YY62Lr567B2+GfHu+hRW=+Q-baN0q5OFCSC7cMW4p+uQ@mail.gmail.com> <CAMP44s0yan_xueZgCbWaiGvB-XwfaihovcA43W0d-4Aurnx=dg@mail.gmail.com>
On Sun, Jan 3, 2021 at 3:16 PM Felipe Contreras
<felipe.contreras@xxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author