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 9332 invoked from network); 12 Oct 2021 14:40:41 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Oct 2021 14:40:41 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1634049641; b=EB1/ExG661XRfylmPKMcSEwTAb7nzbTx/CCDDBI4aoGK1jSNS0qJ5cxMEJgn7dm5bMp/ToirRJ 7eiV1e0ipGYATwGHrPHWLT7Kib35NT+TDF+6Vf0qto93xZRFNcl5lWk3I08ioY92Z6B0TKfDdc 1YBUMCyj8C2lThU11OfFLqaB0Oi6TlmMLIXXsygm3OBzgYpxud2+aN7IjNeuZ7ykBP/TCiINEP eeTyqURSEEnDIU13ViWO2ixXQACPn2JfoDDYm99z1/8tHpwbe44APwi14/XJr4Z1SYsVsaiS/a IAifyhZOfUdQWuVE2g8OVTofwwnegd0hwdY5QzqACp52jw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out3-smtp.messagingengine.com) smtp.remote-ip=66.111.4.27; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1634049641; bh=ezJBlOgxJoOf5NY/AcnKdNW5vxmx53T2XDocu8zKsb0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=Y+CQ3npdFGY43dzJ7dpJZPPKi8Y6g+mT1HdsknV22siJtGT0Wb9lzkbDDcF+RqfWGvNlSz6bMo 0Qf+u/rojTxajIP6vxmZ5aYsm6QCQb5IVkUHw6RKcgLzxJ5AD+wTTmpCN2rrFOPuIkuFVPQzt6 vjS94JOh5/BTSpSqw78oUrciH78psWUQAU06lFvZprImHHLGgRlhych0ToQd9vJLK/fl+IcSWK 19+MpBOMqccciaiczo/AQDQy7sClkaIMQ5PpDpcnSbGXu0yomj9AOMrZN0O/LIME/sSZCVVX+m ULEsogbCMN+CDtU7FSk86adY9FnQ9jQjYa6jZUuMo3G0PA==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=rNtrIqIagpjMlQFOEBz3oIbJH6mNq2lPiy9vfRW5nRc=; b=hOQGjVd4G4dl+vwmQVLUgAtTu8 i+Cmyu3dE7rXMQLL7Bz2/2BqE0K913fbDhEUuoDXVHXuD5KKHgA/O43Ar587TV2bVW3qmaTZ2jK/w lZDO85VLw74Dxi9gFpz3pRwDzK2/lBnlgieLcZxiKdbqgrT1iSNT3yO/aiWVbQC+rmpuBt1b5GHXZ crKT+7aaT6x/Qg5yBOppvs3nTF34sJ6G+NzIztzYEUJI7gbUcF9NVPXbzjwxLx3ZJY0IwCH83YSAo 4usvIKCEq8W9NHPG33ZnH41XOv7hm4vHU2vbMDLmA9+T+1GLRnRDrXjC7vxTTAUOjlnHmB3L/M+PZ s6PE5ILw==; Received: from authenticated user by zero.zsh.org with local id 1maIxM-000Iej-V3; Tue, 12 Oct 2021 14:40:41 +0000 Authentication-Results: zsh.org; iprev=pass (out3-smtp.messagingengine.com) smtp.remote-ip=66.111.4.27; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out3-smtp.messagingengine.com ([66.111.4.27]:54323) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1maIwp-000IMJ-RE; Tue, 12 Oct 2021 14:40:09 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3C27E5C0108; Tue, 12 Oct 2021 10:40:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 12 Oct 2021 10:40:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm1; bh=rNtrIqIagpjMlQFOEBz3oIbJH6mNq2lPiy9vfRW5 nRc=; b=xZS/wzxq4iXJ12kEaZIQJS4Emg2o1Oyr9/MIAdruFIYEoWGgad4ReDNH WLGNaM3M0twYQSP1ExpxYMT/yXsL2wmoYstbvSfhE+GXeGDkXt4F1F57cz5H7hvE ZE8DULq/Tzh3xLDwlxHZto42F0WsJOAAUL0L3j4mzNdlCfUGKPmPqHhN26D8lrmD Vs4HmJfyXuY4NY/a6kSc0HmaQHVI9k5u8e785PtFaTkgBNoB+N7/k0Rhnid5SI0d H7oPrFdBknC0QCDW3GGdALhUM1Hxi/MC/k27PK+luBFEhJ8LEWE3wK9WRml0hBQF SfVhgxOSwMS2B+ar4/R5V7P7Yzpckg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=rNtrIqIagpjMlQFOEBz3oIbJH6mNq2lPiy9vfRW5n Rc=; b=TdoxfbX9T7q5drlWDeEIiHYWCbio2fqhzQAM0WC+VsCKHQqUisKSkY2vF gNDzpdBBYPOcY+uTRjPhdVDdJdmDHqswgyOFSQxiXpjY6e/2oQui7ZQUhjxpDGsv uQ4DxDeT4WDByZWevHK1uI2J4e2KVOGrR3aDEGwrIF1Mh3+kr73aizFb77Xbtaj6 Ql6G0F4Jjt8pjjtCsOjgTmdMBFR7MHHfkO374nOvK7aJ+QuE++sZYZGJWJ86Trte 7PAnPnOsn05o+kztffWnv0cw8xgXJ7MOpICpehjxiq9uxSG021HmTL3XwajnMkg/ Vfi+mWQM/K9268HbBObbQOy5jG8tA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtkedgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggugfgjfgesth ektddttderudenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghn ihgvlhdrshhhrghhrghfrdhnrghmvgeqnecuggftrfgrthhtvghrnhepgfelhedtffeuhf egueelfeffjeegtddtleehvddvueeihfevgfdvgffhvedvkeetnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugdrshesuggrnhhivghlrdhshh grhhgrfhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 12 Oct 2021 10:40:05 -0400 (EDT) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1005) id 4HTJGt20XYz3H3; Tue, 12 Oct 2021 14:40:06 +0000 (UTC) Date: Tue, 12 Oct 2021 14:40:06 +0000 From: Daniel Shahaf To: Zsh hackers list Subject: Re: [PATCH 3/4] docs: _wanted: Clarify the example and point to another one. Message-ID: <20211012144006.GA17948@tarpaulin.shahaf.local2> References: <20210926084347.9927-1-danielsh@tarpaulin.shahaf.local2> <20210926084347.9927-3-danielsh@tarpaulin.shahaf.local2> <47164-1632758103.190051@NBUG.TDW3.g63k> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <47164-1632758103.190051@NBUG.TDW3.g63k> User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 49474 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: Oliver Kiddle wrote on Mon, Sep 27, 2021 at 17:55:03 +0200: > Bart Schaefer wrote: > > On Sun, Sep 26, 2021 at 1:47 AM Daniel Shahaf wrote: > > > > > > - compadd matches...) > > > + compadd -- var(match1) var(match2)...) > > > > Hmm ... I'm uncertain about using var() inside example(). This is > > going to render in "info" as There's plenty of precedent: % ag -G yo 'example\(.*var\(' Doc/Zsh/builtins.yo:227:example(emulate zsh -c 'autoload -Uz var(func)') Doc/Zsh/mod_system.yo:76:example(tt(exec {)var(fd)tt(}<&-) Doc/Zsh/expn.yo:474:example(tt(paste >LPAR())var(process)tt(RPAR())) Doc/Zsh/expn.yo:534:example(tt({ paste >LPAR())var(process)tt(RPAR())) Doc/Zsh/contrib.yo:350:example(tt(zle )var(widgetname)tt( -Nw -f "nolast" -- "$@")) Doc/Zsh/contrib.yo:957:example(:vcs_info:var(vcs-string):var(user-context):var(repo-root-name)) Doc/Zsh/contrib.yo:1560:example(:vcs_info:var(vcs-string)PLUS()var(hook-name):var(user-context):var(repo-root-name)) Doc/Zsh/contrib.yo:2054:example(prompt_cleanup var(command)) Doc/Zsh/contrib.yo:2084:example(autoload var(function) Doc/Zsh/contrib.yo:4641:ifnzman(example(var(program) tt(-)tt(-) var(oldname) var(newname))) Doc/Zsh/contrib.yo:4680:example(zstyle+ ':foo:bar' var(style1) var(value1) \ % (This is just a line-based grep: there may be additional uses of var() in multi-line example()s.) Furthermore, semantically, var() is the correct macro to use here: the argument «matches» (before this patch) does not literally mean to add the string «matches» as a completion; it is a placeholder for actual matches. If info doesn't render that sanely, ideally we'll teach ztexi.yo to do that. How about changing that line to say «compadd foo bar...» instead? > Also, note that listing no matches at all with compadd is still a > completely valid compadd command. Sure. Incidentally, why does «_f() { compadd; }» followed by «f » not print the message set by «zstyle ':completion:*:warnings' format "No matches"»? > This can be useful because you might > generate the list of candidate matches from a command and pass the list > straight to compadd without first checking whether any were generated. > > Doesn't this updated usage imply that there must be at least one? I don't see how. This isn't the synopsis at the top of «compadd»'s docs (the usage summary); it's simply an example of how one might invoke «compadd», whose own docs specify all possible ways to invoke it. Sorry for my long turn-around on this. Daniel