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 21624 invoked from network); 7 Mar 2021 22:12:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Mar 2021 22:12:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1615155125; b=YywOwc2o7pI2BmssDh4kkDT3RR925AzPeYwo+iRVLZ80nTuCJTje1YB73NThuijMeFXOefE7cv Eb3ivpAxuQh400a89Z1fq6jQKu3B13lwBbYsfB4arBAGGhzdQbqNujK9Z/ZS3KtULDcw02HbCF +havlk/+pZVEZS28RI349U0KBQCS7krtJ6Y1a2VbXqf3qWPwk+sxaZ99bcarEep8JL83UWt2iK OjJucZ+zMdC1hM0f/j11EGSZh9XW7KJN+IZ0gKxa4gcX2dbneNzV9ohFDchExSrnBGzeVR2wq7 82i16Par+N923hjwrLXZc/4kk4eo0ZRBJQc9692GmhFxgg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out1-smtp.messagingengine.com) smtp.remote-ip=66.111.4.25; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 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-20200801; t=1615155125; bh=OoMvpV47I7eZwzgbBmoczKBbiHTsx48ffjUYlCeTw4c=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:Cc:To:From: Date:References:In-Reply-To:Message-ID:MIME-Version:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=SSM5VY/W+ZIki4lmV1obM7nb+w2a1XkjrmWyeUBhYztb81OinVqhxDcX/DNfCKr7HTDWNr9rYm R14ciDBolrxeLg+V3xxdcmmW8qBkeUbcULxgh/Xjej0gM/5hA039LYzIoXecQrD9x9K28rCKZ8 mcY8mVd1PpVaWArzUfjuL1lFyx9cAYWRXCKpHKvdiMUJk6U58vvfZtWS1aba6fI7ShO3vgr4S0 M0H9e8yFYKIYIsZGXTuAxCJ5DHa8cterIPgnVvq6WtnVyj5sIKhfvQvIABAT5ADEf5hBA9ZoLx LJeS14llp4XV5uUTacvqizf4in8xS6+JYvs28o93d7BMng==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Subject:Cc:To:From:Date:References:In-Reply-To:Message-Id: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=6H7vmTH8kvcKgXuLcj70TKeqg4fvBz8klzb5q6YwEHM=; b=pGFwgCsKiBkvws/TGqLQTDKAdi QHtN5zKF3ouIATCdYFN7biGWr3r+ILlkFd6WFtHceJF03GbVbtQ4ahAdV18pFQQRDW2m0hMrroApB hbKwlYBj9XFMlZiR7AmrgsV5fHUl+AGj/ZXlxVrFEymrMiJLZMOtTzWd6tltEAD1BrIQmUyGxmB0T 8MLFdVXmYFvE+LKTWzSx1fm02gPrmHy5berT4lOEep2BBBekYxcL2DCP6arYhZVGar+4hevYqiQ+A 2EStxgNJ/bLycadJVPh29Mydh7VIbvpv6yM70emrS60Z3cey3xNnNLg8Sk4FeY4Rea7XOb4mLIndI WhMrgiIw==; Received: from authenticated user by zero.zsh.org with local id 1lJ1d6-0001s3-S9; Sun, 07 Mar 2021 22:12:05 +0000 Authentication-Results: zsh.org; iprev=pass (out1-smtp.messagingengine.com) smtp.remote-ip=66.111.4.25; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42609) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lJ1ct-0001jG-0A; Sun, 07 Mar 2021 22:11:51 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C85FD5C008C; Sun, 7 Mar 2021 17:11:49 -0500 (EST) Received: from imap37 ([10.202.2.87]) by compute3.internal (MEProxy); Sun, 07 Mar 2021 17:11:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:cc:subject:content-type :content-transfer-encoding; s=fm2; bh=6H7vmTH8kvcKgXuLcj70TKeqg4 fvBz8klzb5q6YwEHM=; b=oHyenknF+tG67csQnQBZmuEPQxuzB84CP8aabJJV1c CNEsVry4ouWlk01/CHuDeM4nOi4ikUlXPLWom+4XLbBmFbsqABrlSq9bEud/dhSE zo/cyxaxIjzDA31957Y8QpkxIHHNig6I2ULEMkUykpBQjlLiKFGKIBa257/WfTUM lyuzU1z1jIPd5BnQ0YfV2y6jv2ZvOjfraHUSCy5Ss2xEz+ioEiS0CU8xW3UY51z0 q/uI0zjznr3P7oxhS35GGEq9qbKDXr2L6n6GUFz4X9XW/jQv657n46rd1IomOSpA A6J4GI1KHjLvifnLOpICrm4T3Q3sX/OuRfld1fBI9YyQ== 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=fm2; bh=6H7vmTH8kvcKgXuLcj70TKeqg4fvBz8klzb5q6YwE HM=; b=OnT1WiGNQIjPGDE/acE+mi5a3X4pSr+rd7De/TArIAMc1PNX2bspqSGMy W3JdxpwxY7/+1eTbBJA8AEOFUsw3dWXUwTqc+UQFnRmQqrGwPJtkHmtc3042S2dk x+0YiFUhUSGGvKm0isb8nOPOcjGnkRw4b0RJelHBIWSSFefjF8I8c2YtNpMBuRSU FR+lv7twmwQQRK2830i3Fvz0AeEGNL5pgrmy1tNGJ3mj7XKK25EhWuZ93nfnq5O4 WuI/eJtTD3gZ4bTYj8IxLrV6CfrXLZeTeTlhnn7eB9eBusY2+FJrplKnauL4blAs YKQolm29QNvWSScq/EnSrQu4D3EXg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddutddgudeggecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdff rghnihgvlhcuufhhrghhrghffdcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrg hmvgeqnecuggftrfgrthhtvghrnhepfefhkeefveeileelheeiffdtkedujeelvdfhtdej tdeggedvuefffeelhefhvdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4F15C6B4005F; Sun, 7 Mar 2021 17:11:49 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-206-g078a48fda5-fm-20210226.001-g078a48fd Mime-Version: 1.0 Message-Id: <7f0a752e-2685-4c4b-8a31-b8db1728af1f@www.fastmail.com> In-Reply-To: References: <31598-1614116362.902856@aI-l.maGv.3QD7> <20210224142437.GC9342@tarpaulin.shahaf.local2> <3e0a754f-bbac-404d-92ba-b30f0c736f61@www.fastmail.com> Date: Sun, 07 Mar 2021 22:10:56 +0000 From: "Daniel Shahaf" To: "Jacob Gelbman" Cc: zsh-workers@zsh.org Subject: Re: Completion script for the ctags program Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 48155 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: Archived-At: Jacob Gelbman wrote on Sun, 07 Mar 2021 21:57 +00:00: >=20 >=20 > > On Mar 7, 2021, at 3:42 PM, Daniel Shahaf w= rote: > >=20 > > Thanks for the revision. Not a full review; just two points: > >=20 > > Jacob Gelbman wrote on Sun, 07 Mar 2021 19:18 +00:00: > >>> On Feb 24, 2021, at 8:24 AM, Daniel Shahaf wrote: > >>> Jacob Gelbman wrote on Wed, Feb 24, 2021 at 01:20:24 -0600: > >>>> "--fields=3D[include selected extension fields (flags afmikKlns= Stz)]:flags" > >>>=20 > >>> Recommend to move the afmikKlnsStz thing to after the colon, so it= 'll be > >>> shown at a more appropriate point. Also, it would be helpful to d= isplay > >>> descriptions to the flags using, e.g., =C2=ABcompset=C2=BB (for th= e leading plus > >>> sign) followed by =C2=AB_values -s ''=C2=BB. > >>=20 > >> I moved the possible values to the argument description, but I don=E2= =80=99t=20 > >> have enough time to figure out how to complete them automatically r= ight=20 > >> now. > >=20 > > Like this: > >=20 > > _f() { _arguments : '--foo:bar: _values -s "" baz "a[access]" "f[fil= e]" "i[inheritance]"' } >=20 > Right, I can do that. I wasn=E2=80=99t sure if the extra + and - symbo= ls would=20 > make it complicated. Oh, sorry. I forgot about those. In that case, something like this: _f() { _arguments : '--foo:bar:_g' } _g() { compset -P '[-+]'; _values -s "" baz "a[access]" "f[file]" "i[inh= eritance]" } Plus or minus some code to offer =C2=AB+=C2=BB and =C2=AB-=C2=BB when th= ere's nothing to the left of the cursor. Also, I suspect --fields should be declared repeatable. > >>>> elif [ "$state" =3D "languages" ]; then > >>>> _values -s , languages $languages > >>>=20 > >>> Don't pass unsanitized command output to a builtin. I don't know = the > >>> fix off the top of my head. > >=20 > > This point has been neither responded to nor implemented. >=20 > I sanitize the output a little bit, by cutting just the first word fro= m=20 > the list that=E2=80=99s returned. That fixes lines like "OldC++ [disab= led]" And=20 > I=E2=80=99m not that worried about possibly feeding in incorrectly for= matted=20 > data. What=E2=80=99s the worst that could happen? The listing will loo= k messed=20 > up? An option flag could be injected from an external command into compadd. You don't know in advance what flag that would be and what it would mean= in compadd (you need to consider future compadd too), so this is essentially undefined behaviour.