Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
e subscript flag
- X-seq: zsh-workers 27981
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: e subscript flag
- Date: Mon, 31 May 2010 11:25:52 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=eR+2KFWD1Bp03cwCCLp49jBYzKZZKE5H/xDZfX9u8FE=; b=Jnprqo/EsNvRvZ/LUhOKoLlaS4ggxpkBRqyIJctiBPK+VP+/4A2ju1g5AY4nPzYxee P5GtWk4/ncg25JCRh6MCCDAPmXsbT3dLXV6Ec48g4BvTpAdrt3Sx1dnqQF9aM/FWL1uJ P+rdQ6Xjg7sKrlPQjL+s+JaXQwIN4ZqW/V2Rk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rqng5gswzUZq2Bg/XbV6E1KFufBYWmibM207tmuQAjmPnTqXz1wGFIVtVQ7QGpCFdT Cvq5SGcKAthGnHlo6Jl9L/nRw3oDIOaItyOL7y1L3LLnA9BI6rybZrkiG+vutAKjM/tz Lqxw30PjsN7Uyj86wKrttF2ckFTkcB6+kKDtw=
- 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
I noticed that e is not offered on $a[( tabcompletion, so here's a
patch for that, and this section in the man page:
To match the value of a parameter literally in a reverse subscript,
rather than as a pat-
tern, use `${(q)name}' (see zshexpn(1)) to quote the expanded value.
Would it be better to offer [(e)$name] here? (or both)
diff --git a/Completion/Zsh/Context/_subscript
b/Completion/Zsh/Context/_subscript
index 39bdced..31da97e 100644
--- a/Completion/Zsh/Context/_subscript
+++ b/Completion/Zsh/Context/_subscript
@@ -59,6 +59,7 @@ elif compset -P '\('; then
'(r R k i I)K[all values where subscript matched by key as pattern]'
'(r R k K I)i[any one key matched by subscript as pattern]'
'(r R k K i)I[all keys matched by subscript as pattern]'
+ 'e[interpret * or @ as a single key]'
);;
(|scalar*)) flags=(
'w[make subscripting work on words of scalar]'
@@ -66,6 +67,7 @@ elif compset -P '\('; then
'p[recognise escape sequences in subsequent s flag]'
);&
array*) flags=($flags
+ 'e[interpret * or @ as a single key and use plain string matching]'
'n[Nth lowest/highest index with i/I/r/R flag]'
'b[begin with specified element]'
'(r R k K i)I[highest index of value matched by subscript]'
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author