zsh-users
 help / color / mirror / code / Atom feed
* Question about matching completions with descriptions
@ 2018-06-08 18:13 Nicholas Wiles
  2018-06-08 18:38 ` Daniel Shahaf
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Wiles @ 2018-06-08 18:13 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 466 bytes --]

I have a question about the _describe builtin.
I am building a binary that provides dynamic completions using a completion
function.

Is to possible to provide completions to _describe that will be matched not
only on the text of the completion but also on words/text in the
description? Or, is it possible to turn off completion matching entirely
and have zsh present the user with a verbatim set of completions provided
to compadd or _describe? Thanks in advance!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about matching completions with descriptions
  2018-06-08 18:13 Question about matching completions with descriptions Nicholas Wiles
@ 2018-06-08 18:38 ` Daniel Shahaf
  2018-06-10  1:14   ` Nicholas Wiles
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Shahaf @ 2018-06-08 18:38 UTC (permalink / raw)
  To: Nicholas Wiles, zsh-users

Nicholas Wiles wrote on Fri, 08 Jun 2018 11:13 -0700:
> I have a question about the _describe builtin.
> I am building a binary that provides dynamic completions using a completion
> function.
> 
> Is to possible to provide completions to _describe that will be matched not
> only on the text of the completion but also on words/text in the
> description?

I asked this once and the answer was that that wasn't possible.  I'd
have linked you to the thread but I looked for it and can't find it :(

> Or, is it possible to turn off completion matching entirely
> and have zsh present the user with a verbatim set of completions provided
> to compadd or _describe? Thanks in advance!

Does passing -U (and possibly -V) to compadd do what you need?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about matching completions with descriptions
  2018-06-08 18:38 ` Daniel Shahaf
@ 2018-06-10  1:14   ` Nicholas Wiles
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Wiles @ 2018-06-10  1:14 UTC (permalink / raw)
  To: Daniel Shahaf; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]

It looks like I need to match on the description prior to calling
_describe. Using -U and -V together achieved what I was trying to do. The
kicker was also adding compstate[insert]="automenu" to prevent common
prefix insertion which when you are matching within descriptions the common
prefix could be empty!
Thanks!


On Fri, Jun 8, 2018 at 11:38 AM Daniel Shahaf <d.s@daniel.shahaf.name>
wrote:

> Nicholas Wiles wrote on Fri, 08 Jun 2018 11:13 -0700:
> > I have a question about the _describe builtin.
> > I am building a binary that provides dynamic completions using a
> completion
> > function.
> >
> > Is to possible to provide completions to _describe that will be matched
> not
> > only on the text of the completion but also on words/text in the
> > description?
>
> I asked this once and the answer was that that wasn't possible.  I'd
> have linked you to the thread but I looked for it and can't find it :(
>
> > Or, is it possible to turn off completion matching entirely
> > and have zsh present the user with a verbatim set of completions provided
> > to compadd or _describe? Thanks in advance!
>
> Does passing -U (and possibly -V) to compadd do what you need?
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-10  1:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-08 18:13 Question about matching completions with descriptions Nicholas Wiles
2018-06-08 18:38 ` Daniel Shahaf
2018-06-10  1:14   ` Nicholas Wiles

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).