zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Matthew Martin <phy1729@gmail.com>, zsh-workers@zsh.org
Subject: Re: [PATCH] _compdef: Use zsh/param instead of a glob.
Date: Mon, 27 Aug 2018 10:07:08 +0000	[thread overview]
Message-ID: <1535364428.1254476.1487264352.6CB6A6E5@webmail.messagingengine.com> (raw)
In-Reply-To: <20180827010937.GA61934@CptOrmolo.darkstar>

Matthew Martin wrote on Sun, 26 Aug 2018 20:09 -0500:
> On Sun, Aug 26, 2018 at 10:54:04AM +0000, Daniel Shahaf wrote:
> > In particular, this allows functions defined inside another file to be
> > offered, such as various __git_foo() helpers defined in ${^fpath}/_git.
> 
> I don't think this is a good idea at present. While the completion
> system does use the _ prefix namespace, I don't see anything in the
> documentation reserving the namespace to the completion system. There
> are already a number of projects[0] that use the _* namespace.

In general, it is better to offer too many completions than too few.
(In other words, better to have false positives than false negatives.)
For example, the other day I needed __git_branches; I didn't
particularly mind to have the entire timestamp-named z-sy-h cast there
since it didn't get in the way, due to namespacing.

That said, if there is some way to generate a set of names that is less
complete but has fewer false positives, we could offer that set under
one tag and the ${(k)functions[(I)_*]} set under another tag, to allow
users to get their preferred way by setting the tag-order style.

> Perhaps in 5.6 document that only completion functions should start
> with an underscore and then apply this patch for 5.7 so that users
> have time to adapt.

I don't know if we should deprecate user functions being named `_*`.  We
could point out in the docs that the completion system uses this
namespace so the world would be a _slightly_ better place if user code
used some other namespace, but I would stop short of making this a hard
requirement.

(Incidentally, I never understood why completion functions didn't use a
proper namespace, zshfoo_* or some such, like virtually everyone else —
but that ship has sailed.)

Cheers,

Daniel
(except gettext)


  reply	other threads:[~2018-08-27 10:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-26 10:54 Daniel Shahaf
2018-08-27  1:09 ` Matthew Martin
2018-08-27 10:07   ` Daniel Shahaf [this message]
2018-08-27 18:22     ` Bart Schaefer
2018-08-27 18:47       ` Daniel Shahaf
2018-08-27 19:07         ` Bart Schaefer
2018-09-03 13:44 ` [PATCH v2] _compdef: Change and add sources for completed completion function names Daniel Shahaf

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=1535364428.1254476.1487264352.6CB6A6E5@webmail.messagingengine.com \
    --to=d.s@daniel.shahaf.name \
    --cc=phy1729@gmail.com \
    --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).