about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2021-11-12 20:44:48 +0100
committerOliver Kiddle <opk@zsh.org>2021-11-12 20:44:48 +0100
commit2fe9ab281380f56a4f492eb644da5bab2e0e7b0d (patch)
tree1f40bd426881aab197289fa9b80d6e631619a569
parent8ea597722287a9a2f827f754364491bb5f033c15 (diff)
downloadzsh-2fe9ab281380f56a4f492eb644da5bab2e0e7b0d.tar.gz
zsh-2fe9ab281380f56a4f492eb644da5bab2e0e7b0d.tar.xz
zsh-2fe9ab281380f56a4f492eb644da5bab2e0e7b0d.zip
49566: document the _default function
-rw-r--r--ChangeLog2
-rw-r--r--Doc/Zsh/compsys.yo9
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ad9c4609..1be5a36e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2021-11-12  Oliver Kiddle  <opk@zsh.org>
 
+	* 49566: Doc/Zsh/compsys.yo: document the _default function
+
 	* 49564: Completion/Unix/Type/_files, Doc/Zsh/compsys.yo: always
 	use descriptions included in the file-patterns style and allow
 	the recursive-files style to also work in those cases
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) ... ])