Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: completion for parameter flags
- X-seq: zsh-workers 29456
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- Subject: Re: PATCH: completion for parameter flags
- Date: Sat, 4 Jun 2011 14:39:52 +0200
- Cc: "Zsh Hackers' List" <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=BLEF890B3r92JFXOCcAVpFUGsi5nghJLqpCHFOab1Nc=; b=YEG/SQjQ2oBp7plUHL8fQUwC8J3pyVGyeH+sS8iatP4N1EDiftY76D0em190NvM8XN CBTCiRtylJq8AW50YNppWQZ0P1TuFm05oRsPZ24+FxNneCf9UdhHhJQ0Rw924i1sv6+2 J57i2xfjrTumFDYKH4nEhDY4XSaQMxYMyhUFQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=XiDjLBWtwuaCoN5bXXjVRxFN5FV2Fc49tfoIkh9f1yz+Qa4lgqCJhNahOndfub8Qxt TxixR1Jxk05M4eRwzwk2K1zlXp45ZAJjNl7YIXKooOKXbS7LgujS5ytnYi2L3WCCwr6N SgYtqNXNPXlMQ+5xwBeY0cbAJ2k5UH10qnvbQ=
- In-reply-to: <20110603215453.1260c7f0@pws-pc.ntlworld.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20110603215453.1260c7f0@pws-pc.ntlworld.com>
On 3 June 2011 22:54, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> It has not hitherto been possible to complete parameter flags because
> "${(" is not treated as a suitable location for parameter completion,
> so you drop through to ordinary argument-context completion.
>
> It turns out it's quite easy to detect the unbalanaced open parenthesis;
> indeed, the context check for parameters already does, carefully
> remembers the fact, carefully does some more checking, and then
> carefully remembers that all that extra checking was pointless. I'm not
> sure why it goes to those lengths, but experimentation suggests simply
> noting that we're in a brace parameter and not bothering with the code to
> deal with parameter names gives us enough for the _brace_parameter
> function to pick up on.
>
> So here is some brief C code and an expanded shell function for
> parameter flag completion.
This looks nicer than the hack I posted, but "${(<tab> shows me glob
qualifiers. (Ie, with the leading quotemark). foo${(<tab> does nothing
at all. (---- no match for: `parameter' or `corrections')
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author