Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: document _default
- X-seq: zsh-workers 49566
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: document _default
- Date: Thu, 11 Nov 2021 23:42:31 +0100
- Archived-at: <https://zsh.org/workers/49566>
- List-id: <zsh-workers.zsh.org>
In a github review, I made a suggestion of adding a call to _default.
The fact that it isn't explicitly mentioned in the documentation
elicited further queries. It is somewhat mentioned under special
contexts but you have to know that _default corresponds to -default-.
This adds a brief explanation.
Oliver
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 1adceb536..e65f2956b 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -4404,6 +4404,15 @@ Include the leading underscore (`tt(_)') in the matches.
)
enditem()
)
+findex(_default)
+item(tt(_default))(
+This function corresponds to the tt(-default-) special context which is
+applied where no completion is defined. It is useful to call it under
+certain error conditions such as completion after an unrecognised
+subcommand. This applies the concept of graceful degradation to the
+completion system, allowing it to fallback on basic completion of
+commonly useful things like filenames.
+)
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