From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30964 invoked from network); 11 Nov 2021 22:42:50 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Nov 2021 22:42:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:From:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=oCTjKe0q2+L/uM69i/MhQFieY0qw0K7IukAm3MIX6Ss=; b=iC0TifR/B+xIHgpjKF1nBfwUD8 iIRNx6JLTDWL6xHQBbNrgZOzgcy9kbJRg3Uj+C5LfZJDULyThIUUvJ2mfcgHmpMgd7YQCb1w9ps5m om9ak7RoSXJF5347HqxbCb6/QERU/gkml08k4/DAGtuXwbcABnNnuJeQMID/0kjNwjyXkPgSWB61C cqqspXShsC03yS0Wv7LPhgXfQDUd5p94Vb3/APeYLIrU/CNwvS8AQQSNwDaYVSsdJtUs768wm0D97 S1sDd3gvF9984HBCPm/NlUlJg+Nf755m0/eIAgmDL6/1Dh3PQdtD+QZaB30lNx4R7+Kxph3FAiVT6 guXMMNWw==; Received: from authenticated user by zero.zsh.org with local id 1mlImN-000BHj-TI; Thu, 11 Nov 2021 22:42:48 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mlIm9-000B0p-1T; Thu, 11 Nov 2021 22:42:33 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1mlIm7-000PvY-Pg for zsh-workers@zsh.org; Thu, 11 Nov 2021 23:42:31 +0100 From: Oliver Kiddle To: Zsh workers Subject: PATCH: document _default MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <99666.1636670551.1@hydra> Date: Thu, 11 Nov 2021 23:42:31 +0100 Message-ID: <99667-1636670551.792973@ZDYT.bwGQ.cs-t> X-Seq: 49566 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: 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) ... ])