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=-1.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22955 invoked from network); 29 Aug 2020 19:59:19 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Aug 2020 19:59:19 -0000 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:MIME-Version:References:In-Reply-To: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=/Fkaj8ZLc2eeMcYg1owMVbAxP4e7SXqyM3Fqs8wqlzo=; b=fwUiDgkhr/iCVdBve86Qxz0RPO b3LqOcYWACD+6W4R1EcS8jisqMaB55apN4fxewKliSYOmMpmj1vAoezNn712qiA6tWO0EaQ6Tozlr Pfv456nXblJrH8LIjxPCjJx0hNNdniVRocHQyPebVg5vyTh7bOLtLoUISJ/F0NEPVoprpUtkyNCDE 8uKRRFT2CtC4C8S0mh6pWXLQKgob90ssvhXTHNehlyrg1FT/ewL1b8HAaAdDgTbZLPGG7IpbpRo/O hLThFB8gq4VUZwmjrGgIEwcrndvlXFDJi9ssQHAZG25UZUK2UKyI56l4vJ+H5KtTAcH3ApxBT+6YB xLmhhelg==; Received: from authenticated user by zero.zsh.org with local id 1kC70O-000HXF-Bl; Sat, 29 Aug 2020 19:59:16 +0000 Authentication-Results: zsh.org; iprev=pass (out5-smtp.messagingengine.com) smtp.remote-ip=66.111.4.29; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=skipped; arc=none Received: from out5-smtp.messagingengine.com ([66.111.4.29]:40473) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1kC705-000HO4-Ss; Sat, 29 Aug 2020 19:58:59 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id DB9315C00A6; Sat, 29 Aug 2020 15:58:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 29 Aug 2020 15:58:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=fm1; bh=/Fkaj8ZLc2eeMcYg1owMVbAxP4 e7SXqyM3Fqs8wqlzo=; b=AhlDPT2nbI56CRBI+E79mxtFgqfzX8KSI6iNYjFHCM v/rIw8QyE5sOQ3VxPVdbMbwGIeukujitalC9iNsGcVrHngnO8Cyi7EERdfa3YSLh 8bo3763K1FakouzkIXn0cfvE0ZIGYr9xAWZuzvBGbk4zTd50Vl1D89QVe1VvmtNA WrFkRu/TueHnTVeQgttizrHaD3+XItfPEyuEkORg2JBGLDqTMy/CQ/d/cEgM+P27 2Pg2IPXAOVoSG4ZkEVjoada3DBvNH4mOevaKNmKFWjwstb7Uk3m2efBlUl3aagL0 UXAOg9Xw/kK/yMME7zJXa9bKa+nfRTZz3amxlwlV+uLg== 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=fm3; bh=/Fkaj8ZLc2eeMcYg1owMVbAxP4e7SXqyM3Fqs8wql zo=; b=mkjxcIbXXU+wlVzG/2CGcPWTcKRbu8Jb1oQNl4TPxBs9gxcZyv7Ow4S+N pZXZHGVWhSdEwUPy/RTckOyq1xuzOxXCvUErqhDP0VZUJayIJGnbWcdF4SogLAyU 8MtNjqZ/fScGaGHnmA+YyVXOd0IeUjRFDojSH3k9SzPS97ib5eGxQm7StXFuA/0k 7Of79FKAZ61vn7c4QE3pg1gzIgIMjAKAvXOBaJ1ckBjtskHwYwarz9Hp631cR7v0 LVrXCN7iLYUzFb8Nvw0KvEwQyY0VKqVNxZA0eD10Zc7nrZ4YZ8cNJNZFI6H/I1ad C/qKN8l021agGfuDFTpMwouJdVd+w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudefuddgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfgjfhfogggtgfesth hqtddtredtjeenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghn ihgvlhdrshhhrghhrghfrdhnrghmvgeqnecuggftrfgrthhtvghrnhephfdtteefheevue dthedutdeifeegteettdejtdffheduieeijeelteetkeduteehnecukfhppeejledrudej kedrvdefrddvfeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Received: from tarpaulin.shahaf.local2 (bzq-79-178-23-238.red.bezeqint.net [79.178.23.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 59CAE3280059; Sat, 29 Aug 2020 15:58:39 -0400 (EDT) Received: from tarpaulin.shahaf.local2 (localhost [IPv6:::1]) by tarpaulin.shahaf.local2 (Postfix) with ESMTP id 4Bf6j91FBJzdT; Sat, 29 Aug 2020 19:58:37 +0000 (UTC) Date: Sat, 29 Aug 2020 19:58:35 +0000 From: Daniel Shahaf To: Oliver Kiddle Cc: Zsh hackers list Subject: Re: PATCH: minimal dropbox command line completion (and $compstate[nmatches]/$ret) Message-ID: <20200829195835.3f1b224b@tarpaulin.shahaf.local2> In-Reply-To: <61559-1598701545.540695@NVxH.JTOI.LNn_> References: <20200828022232.0914170c@tarpaulin.shahaf.local2> <842686448.1489803.1598603222115@mail2.virginmedia.com> <20200829003857.0a14a362@tarpaulin.shahaf.local2> <61559-1598701545.540695@NVxH.JTOI.LNn_> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Seq: 47351 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: Oliver Kiddle wrote on Sat, 29 Aug 2020 13:45 +0200: > Daniel Shahaf wrote: > > I guess merging [1] and extending it would be the best option > > technically. However, that file appears to be under the GPLv3 (per the > > LICENSE file in its repository). Is that a problem? =20 >=20 > I think we should avoid doing that if at all possible. Where we've had > functions under different licences it can create more work for people > packaging zsh than it would be to just rewrite the function. Different > distributions and operating systems have different rules, some remove > them, some add complicated merged licence files and many ignore it. > I should probably revisit that idea of having a separate Contrib > directory for some functions. It was partly stalled on the naming. >=20 > To me it would seem bad form to simply take something found elsewhere > without successfully contacting the author. If you get an answer, > chances are they'll be more than happy to contribute it under the zsh > licence. To be clear, I wasn't proposing we just copy code from github to zsh.git without contacting authors. I was analyzing the problem from different angles (technical, legal, social), each one separately, and then combined the answers. > When handling subcommands, it is always a good idea to fallback on > calling _default wherever you have a subcommand for which there is no > special treatment. Don't break file completion probably the most > important rule of writing custom completions. Add this to the documentation somewhere? > > Aside: I wonder why we don't use a =C2=AB_call_completion_function() > > { readonly -i n=3D$compstate[nmatches]; "$@" && (( $compstate[nmatches]= > $n)) }=C2=BB > > wrapper around calls to $_comps[foo]: that'd save every single > > completion function having to manage $ret explicitly.) =20 >=20 > The original concept was that there would be cases where you explicitly > want to allow completion to continue despite having added matches. > In practice this is very rare but does occur. Also, we rely on the > return status in many more places than just the calls of $_comps[foo] in > _dispatch. Getting it wrong tends to be most apparent from _approximate > acting when it shouldn't but it can break other things such as tag > loops. >=20 > It could be possible to redesign this if we allow breaking changes > sometime. Perhaps with keys in $compstate to indicate continuation. Thanks for the explanation! Cheers, Daniel