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 24190 invoked from network); 17 Oct 2021 16:49:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Oct 2021 16:49:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1634489387; b=IIU9mr2k89VzsyeedkUGL6mBxldOFdYHSu8Sbm+8/AFK06ji83U3WNWdRwXiZMoM3ymjrTf4lb FJVsCxEw9+nfvxdfHAzUCq1EEQqwOtuC3XqC85sm3pOvkrpZsVyYTOVk40X48AA/ujaIZPrSAE 3mzyg/zxiwplQzjVHUslZurw9CMgP02G88WwixbkfmeF6E4jzhZKbaR0M/9dcAjZB/gQsVT+Vj /bYMOA19Ug/H5PSwPueP089o8myN6YjcJaA2dcXEqMuLAN5YxQyTZGvIbiarS2WVQEM8ImoWrf oCcCoZeRlyyqJJkogQFK0+E3piudlnrj6CivhnmZMImHBw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout5-smtp.messagingengine.com) smtp.remote-ip=64.147.123.21; 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=1634489387; bh=+FTakanwwXhLWakXQABGvdc4Kv70hqPitLg0IfWVYtc=; 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:Cc:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=JnkzciZ22W+lQkG6jLof22NSuWHu//Zxboi0OZqfnIHI/w7XKVKMUQhkJ6Hrs8TPPZTfvLmhxQ hM79EypypvUrR8taeeZjCbxBrtHNXyQ8c2Ed16bznwyF3zPCgjbN67NXCHc8q1gIyRjvIPANks AcWtsYURIa4677E+OZbWxZ1xDNtFMZeNMIUcU4SC9cCb6BxYjMU9n/t+CeIckeftRBN+HqRIzh 7fsSrIduNV+yO3kFYZaLGkAS8pFStmj2Ni35X7JKSH7iznN1j2X+jDbmqurq83RsBoak9g0uEQ /eqWO7AMM5pMQhX0NjftQLp8fvcsr5AX8jYeVEawpOir/w==; 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:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=IyIH8gNc5K6MwwzkxxkaLlEVsGUba/DvlV+QGLCgJ7o=; b=F8TK8Z64iMCpooQs+cz0jZ5aEd 2QPsjEa6cfol6hxwfAjXrs5axgfXU30eN6opPUhF4SvMLAY3R8Ysm0OBmjq3xpYqCWHKbIlfsSZao DsVOjJ/N44mpip4ZpVkai+Cw2Cb7eXPTTolSyTVMwCJpmUZaozD+NhHx5TlzNu0wGR5amSDwlf9nW 1qTvzbgEo4W/nea6Vw6p4vZBaqOdXhRjIWbLcZhHaS53IxuWGsjrjhlTH5BxGLk6x5nBuM8D7GInb 7vgFSKAh15ZwYQRexyXpOE1IbggnJBLCrk4y5OWcPcS0LJ+iOoKOs2Zwim2b2kygW8Sig9uXiCq6W eUKElQSQ==; Received: from authenticated user by zero.zsh.org with local id 1mc9M1-0004RB-2o; Sun, 17 Oct 2021 16:49:45 +0000 Authentication-Results: zsh.org; iprev=pass (wout5-smtp.messagingengine.com) smtp.remote-ip=64.147.123.21; 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 wout5-smtp.messagingengine.com ([64.147.123.21]:42999) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mc9Lf-00049p-Hn; Sun, 17 Oct 2021 16:49:25 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 32A09320098D; Sun, 17 Oct 2021 12:49:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 17 Oct 2021 12:49:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm1; bh=IyIH8gNc5K6MwwzkxxkaLlEVsGUba/DvlV+QGLCg J7o=; b=Gl/D2eI5adfh06yiQPhUsuRZkng0X/HaQNf72dz/F7Heq6RE6Qb/HdOi wxf9IJQH7C/30WK0GkffaPmyMAd5evU2pkFrUnNOcl+aA8vGay3VvIo2Agcs9LXO jl5YDiXGSbBqcXQdTqfz/UEkrNJeS9h0Qz6tBrRWwKdlAxy0/FGCOnoe1EPpVvr1 WoBKSi/eCMM/2aWxRR9VUpaJqmGqKGxymBsl6Maqoc30mGKC9i5V2WLlA1ReDhCU ovEOvNSnaVGL/uvLJyiF19w0IOhEJl/aExkZ+U+oIXSksSfGoRMQvlooTjynZCyN WXAplv92rLCJbdGi2p7/yXjuj7eYjw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=IyIH8gNc5K6MwwzkxxkaLlEVsGUba/DvlV+QGLCgJ 7o=; b=Yq4VbM4uTvZkLT+u+ABCFhGpM8l0eLEA9zUsAh8nX4CyWx70lQoGMWNjy WZGIWUEMLQF+fTLTWej/pi8CtCBKuxnGCSyz2CX75ylR7Eo3ayiUe2kCMmglHFow Zgk2A2UwRx3pzgxNlPxMqojTFx0dp9bDovZhOdZGOMZX473Q8RTiNB7tysLWBmtB xZV3ylsCsOpISIqKgagDcCbar0llLWLHIR+tKQW+nkBOcbJxBHNtT1C3w7EDszPI FcJfpaFmUDHKfpMAaEbDtyMNuRaT7wM8aJeeKrBNzR8pMsH31zBCBv7CEqGEsZKf Uy0s0gzHbFyE0fhNy17eefy83V/NQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddukedguddtgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtugfgjggfse htkedttddtreejnecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceougdrshesuggr nhhivghlrdhshhgrhhgrfhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpefgkefgfeejgf dvvdfguddtleelkedvfeetiedtudfhveevveduhfdvveeffedvueenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrsh hhrghhrghfrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 17 Oct 2021 12:49:19 -0400 (EDT) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1005) id 4HXQvf0G3nz4vT; Sun, 17 Oct 2021 16:49:17 +0000 (UTC) Date: Sun, 17 Oct 2021 16:49:17 +0000 From: Daniel Shahaf To: Jun T Cc: zsh-workers@zsh.org Subject: Re: How about separating "_arguments --" into a new function? Message-ID: <20211017164917.GA30795@tarpaulin.shahaf.local2> References: <4B74EF96-AE73-4D40-ACDD-9999DFFDA1A8@kba.biglobe.ne.jp> <20211012160428.GD17948@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 49490 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: Jun T wrote on Thu, Oct 14, 2021 at 19:58:17 +0900: > 2021/10/13 1:04, Daniel Shahaf wrote: > > perhaps the tool could be designed with an eye towards updating existing > > completion functions? For instance, perhaps the tool could inspect the > > existing _cmd file and omit from the output any lines where the > > --foo[lorem ipsum] part already appears in the file? > > Such a tool is useful, of cause, but analyzing the existing _cmd is > would be quite complicated, I guess. > Well, the tool doesn't need to update the file by itself. Even if it simply spat options grouped into three categories — "definitely in the file", "definitely not in the file", and everything else — that'd still save most of the work in updating the file. > >> Or just using $_args_cache_cmd is enough? > > > > If it is enough, then it should be made more discoverable. > > I guess it is enough since no one is requesting to separate _arguments. > How about the following? > Are we happy with documenting it as a first-class feature, i.e., one that we would be expected to continue supporting? Or would we rather document this as a "we may change this in the future" thing? Flow-wise, the mention of _gnu_generic seems to me to be oddly placed: it's right between mentioning the variable's existence and use. I suppose I'm suggesting to reorder the information being added. Not a blocker, of course; just nice to have. Typos: "commnd", "chache". Would prefer «print -r --» in case of backslashes, or perhaps just «typeset -p». Cheers, Daniel > diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo > index 89b918d60..c00270f3d 100644 > --- a/Doc/Zsh/compsys.yo > +++ b/Doc/Zsh/compsys.yo > @@ -4237,6 +4237,17 @@ as `tt(-)tt(-enable-foo)', but the script also accepts the negated form > > example(_arguments -- -s "LPAR()(#s)--enable- --disable-RPAR()") > > +The list of var(spec)s derived from the help text is saved in an array > +parameter `tt(_arg_cache_)var(cmd)' where `var(cmd)' is the name of the > +command. If `tt(_arguments -)tt(-)' (or tt(_gnu_generic)) does not work > +satisfactorily for a commnd `tt(foo)', you can save the specs in a file > +`tt(_foo)' by > + > +example(echo ${(qqq)_arg_chache_foo} > _foo) > + > +and use it as a draft of your own completion function for the command > +`tt(foo)'. > + > em(Miscellaneous notes) > > Finally, note that tt(_arguments) generally expects to be the primary > > > >