Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG?] Unexpected behaviour with `compdef -p`
- X-seq: zsh-workers 43593
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: Re: [BUG?] Unexpected behaviour with `compdef -p`
- Date: Wed, 3 Oct 2018 18:02:32 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181003170235euoutp018d89c44519625ad0a5aa1206f18d41f3~aJ-TdvP7m2247022470euoutp01B
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1538586155; bh=7xu2EiD6E0lmtk9N+Aq8VZKTn07H9ygUfmviH1Nl6EU=; h=Subject:From:To:Date:In-Reply-To:References:From; b=iR/9y6JW/rXoUDcEtE+SBeiA23qvj1uKhrCkXKGU6HYUux7uWzrDLxgF9z4IUtDVv BuEzAJG253PCG/B28iXeBfFQEbnTtHCGKNVu9Xj2X+GtH1+WVWn496idiZAgFtQbWs cn18n2T5nN/KQwmB2gy/pkT7wLOgii4YFORcHuUg=
- In-reply-to: <97754736-115B-4EF2-B10C-9DE17345C9DB@dana.is>
- 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: <CGME20181003145704epcas2p11789ab46bc01269295dacdb9cbe9f9d6@epcas2p1.samsung.com> <97754736-115B-4EF2-B10C-9DE17345C9DB@dana.is>
On Wed, 2018-10-03 at 09:56 -0500, dana wrote:
> I was trying to use `compdef -p` to avoid having to list out a large
> number of commands i want to complete that all have the same prefix,
> and i found that it doesn't really work the way i expected — it
> destroys the completion output.
>
> I am not that familiar with the part of the completion system that
> deals with this. Is the above in fact the intended behaviour? (If it
> is, what scenario would one use -p in where it wouldn't cause these
> problems?)
The code's not *that* complicated, this time --- look in
Completion/Base/Core/_dispatch
The loop with _patcomps is handling the compdef -p. Then the normal
name look-up happens. This looks like it could be trashing your input.
With a judicious "if" around that bit, and probably also setting name
and comp in the loop above, you ought to be able to get it to work, I
think.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author