Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _compdef: Use zsh/param instead of a glob.
- X-seq: zsh-workers 43336
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Matthew Martin <phy1729@xxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: [PATCH] _compdef: Use zsh/param instead of a glob.
- Date: Mon, 27 Aug 2018 10:07:08 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=/6GqSQ ENWgaL1xDzXygEshWrS5Co95RQbSOXlCoDSro=; b=iGKe2euVCSf7IbNiqsvWgu jR388h2LvOQk++WncVCxaTTR/82pC5f2A+YPpY7kuDJtOXndllJjfvpq4Woa3YtQ IzAUbogEOBmeleD6bkUmp18JuXkJhzGOe2vLKB1b/umJJV6F6nvKLYBXj1EUUT3M /9GUYd/mYbv3j4vxAyyzMTgzdd4VUDI4ub04nGu1BtmOEalbl/jMhslYh2I989hv GK3Z/CUnBQ56EEtLWrnxzu5yrKZY0pl24UlAz8J40vMA7jaCTh1KAchzoQRDahbE wONQVo+wPKtXuX7igiDTHFhncdRBi1e+4/5wDpLUdOnNsHw1g5cOayR4xly4SzNQ ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=/6GqSQ ENWgaL1xDzXygEshWrS5Co95RQbSOXlCoDSro=; b=jbqnyPNWdn60o09Gl07uxJ IEBrNf9oz5GH4shKkRqEfT8Ap+mc5jkGkp7+eHZ0xah4Er9z1Sd/zSwxdpCwjGrH poqzqxkPGdcqV1McptaCiZllr7Ai569Gf62S2dSbCRN/uF6Dr7VWtPEIHpOnTOP2 Ls+jEcu6a4Ut19MktjbSxZdw/iQ3ph4zU7nNk8+YP0ukRzNnowiWivpGgWNenPfW i5l9wmXe6xrF89RV7U87SxtoNa23dr7eCAFfIrf0Lcnou+26Zf+HHXsUochDEQ3y ZNJyZOfsu3EqSZ1PjIH8E4U1UbUrvJjPqVdwAle7uowy4avfzwFSNsmyIYqewTQg ==
- In-reply-to: <20180827010937.GA61934@CptOrmolo.darkstar>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180826105404.31846-1-danielsh@tarpaulin.shahaf.local2> <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)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author