zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Oliver Kiddle <opk@zsh.org>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: minimal dropbox command line completion (and $compstate[nmatches]/$ret)
Date: Sat, 29 Aug 2020 19:58:35 +0000	[thread overview]
Message-ID: <20200829195835.3f1b224b@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <61559-1598701545.540695@NVxH.JTOI.LNn_>

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?  
> 
> 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.
> 
> 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 «_call_completion_function()
> > { readonly -i n=$compstate[nmatches]; "$@" && (( $compstate[nmatches] > $n)) }»
> > wrapper around calls to $_comps[foo]: that'd save every single
> > completion function having to manage $ret explicitly.)  
> 
> 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.
> 
> 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


      parent reply	other threads:[~2020-08-29 19:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 20:15 PATCH: minimal dropbox command line completion Peter Stephenson
2020-08-28  2:22 ` Daniel Shahaf
2020-08-28  8:27   ` Peter Stephenson
2020-08-29  0:38     ` Daniel Shahaf
2020-08-29 11:45       ` Oliver Kiddle
2020-08-29 13:49         ` Peter Stephenson
2020-08-29 19:58         ` Daniel Shahaf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200829195835.3f1b224b@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).