Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH v2] Re: [PATCH] _add-zle-hook-widget: New completion.
- X-seq: zsh-workers 38921
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH v2] Re: [PATCH] _add-zle-hook-widget: New completion.
- Date: Fri, 22 Jul 2016 20:45:40 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1469214982; bh=DBcTT1V3RY56KQ8VLJkBplkSXztrO6YePwXoIt8mc/c=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=SfIhMBIQLp8S4XJbvi1MHkGtaBjxMfJdust5YW6myR0uK+zYDMDFdL50nM47maheKoISOYzEJwzEj0sw/aMqcuW9IumKZzFBDkHyk9RFfgBWLn8kRKnZfaFUYjZH0LXPKVOqXrEtyJjhIyW09f7IiDCZgwK/oMWwyiowSjXRBev53djDUYzYGQz5IS6IMW/76/Q7EUgkjhvwwmyqHfSd7vIbUhPg3norab0ayu1CJrrHvAb4aUFpUs2bPohVRZbR+i056vOQxpioNk2hWZ7iZdjCGe/Awe8CqofEO4j0SuSQWt4dZNr51jWFh/EFpTU2ifMdwutiuY62s89PVablog==
- In-reply-to: <20160722062259.GB3457@tarsus.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <160716185103.ZM5258@torch.brasslantern.com> <1468767614-9635-1-git-send-email-danielsh@tarsus.local2> <91351.1468835277@hydra.kiddle.eu> <20160720065421.GE28939@tarsus.local2> <22468.1469114906@hydra.kiddle.eu> <20160722062259.GB3457@tarsus.local2>
Daniel Shahaf wrote:
> > Furthermore, while checking that this wasn't intentional I noticed
> > a couple of functions that use _normal where _default was meant.
>
> _default appears to be undocumented.
Actually it sort of is documented: the section on special contexts which
mentions -default- and says that default implementations exist named
_context. Should there perhaps be findex entries there for each context?
Thinking about it, perhaps the original intention was that _dispatch
should be used but direct calls to _default are widespread and date
back to early times. How about the following.
Oliver
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 8792324..460cbb6 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -4217,6 +4217,12 @@ This function completes words that are valid at command position: names of
aliases, builtins, hashed commands, functions, and so on. With the tt(-e)
flag, only hashed commands are completed. The tt(-) flag is ignored.
)
+findex(_default)
+item(tt(_default))(
+This function corresponds to the tt(-default-) special context. It is
+also used directly as a fallback when a function is unable to provide
+more specific completions.
+)
findex(_describe)
redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ @ ))ifnztexi( )))
xitem(tt(_describe )[tt(-12JVx)] [ tt(-oO) | tt(-t) var(tag) ] var(descr) var(name1) [ var(name2) ] [ var(opt) ... ])
Messages sorted by:
Reverse Date,
Date,
Thread,
Author