zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: e subscript flag
Date: Mon, 31 May 2010 11:25:52 +0200	[thread overview]
Message-ID: <AANLkTilDNuaXxaRSvX_HuOijsJJdn2jWyl28cw0Z4Kfh@mail.gmail.com> (raw)

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


                 reply	other threads:[~2010-05-31  9:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=AANLkTilDNuaXxaRSvX_HuOijsJJdn2jWyl28cw0Z4Kfh@mail.gmail.com \
    --to=mikachu@gmail.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).