zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: [BUG?] Unexpected behaviour with `compdef -p`
Date: Wed, 3 Oct 2018 18:02:32 +0100	[thread overview]
Message-ID: <20181003170233eucas1p1e6f2fdb6bf9aed8e0b2da1848c8405df~aJ-SE1R4G0648706487eucas1p1n@eucas1p1.samsung.com> (raw)
In-Reply-To: <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



  reply	other threads:[~2018-10-03 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181003145704epcas2p11789ab46bc01269295dacdb9cbe9f9d6@epcas2p1.samsung.com>
2018-10-03 14:56 ` dana
2018-10-03 17:02   ` Peter Stephenson [this message]
2018-10-04 18:44     ` dana

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='20181003170233eucas1p1e6f2fdb6bf9aed8e0b2da1848c8405df~aJ-SE1R4G0648706487eucas1p1n@eucas1p1.samsung.com' \
    --to=p.stephenson@samsung.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).