From: "Mikael Magnusson" <mikachu@gmail.com>
To: zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: _subscript quotes too much
Date: Wed, 9 Apr 2008 13:53:00 +0200 [thread overview]
Message-ID: <237967ef0804090453i19952670ic40093e119bcd983@mail.gmail.com> (raw)
In-Reply-To: <20080409122053.3ddfdc42@news01>
On 09/04/2008, Peter Stephenson <pws@csr.com> wrote:
> On Wed, 9 Apr 2008 12:00:25 +0100
>
> Peter Stephenson <pws@csr.com> wrote:
>
> > As far as _subscript is concerned, it would have to be taught the rules for
> > which characters can be backslashed, this applied with ${...//.../...}, and
> > then the -Q flag passed to compadd. This shouldn't be too hard.
> It wasn't.
Thanks for the explanations and the fix. I read the section in
zshparam you referred to, not sure if i'm more or less confused now
but I think I found two typos.
"This is because parameter expansions may be surrounded balanced
braces, and subscript flags are introduced by balanced parenthesis."
should probably be 'surrounded by' and 'balanced parentheses'.
> + keys=(${${(kP)compstate[parameter]}//(#m)[\$\\\[\]\(\)\[\{\}]/\\$MATCH})
wow :).
> If you can find cases that still don't complete successfully
> it can be tweaked further.
Well,
typeset -A hi
hi=(\" hello)
echo $hi[<tab>
should ideally produce "$hi[\"]" but I don't even know if that's
possible or worth it. :) Or even
hi=(\* hello)
echo $hi[<tab>
would produce $hi[(e)*], but I guess at some point I just have to read
the manual and learn some of the subtler rules instead of depending on
the completion system as these are explained quite clearly there.
--
Mikael Magnusson
next prev parent reply other threads:[~2008-04-09 11:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-09 0:08 Mikael Magnusson
2008-04-09 0:11 ` Mikael Magnusson
2008-04-09 8:49 ` Peter Stephenson
2008-04-09 11:00 ` Peter Stephenson
2008-04-09 11:20 ` Peter Stephenson
2008-04-09 11:53 ` Mikael Magnusson [this message]
2008-04-09 12:11 ` Peter Stephenson
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=237967ef0804090453i19952670ic40093e119bcd983@mail.gmail.com \
--to=mikachu@gmail.com \
--cc=zsh-workers@sunsite.dk \
/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).