Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: setopt globcomplete and () broken



On Tue, 10 Mar 2009 13:51:46 +0000
Peter Stephenson <pws@xxxxxxx> wrote:
>     elif [[ "$tmp1" = (#b)(*[^\$])(\(\([^\|~]##\)\)) ]]; then
>       tmp2=( "$tmp2[@]" "${match[1]}((${tmp3}${match[2][3,-1]}" )

I thought I was on the way to understanding what was going on here, but
this attempt to match some form of glob qualifiers has stumped me.  Why are
we specially matching a pattern ending with glob qualifiers wrapped in
double parentheses?  What we're matching against, $tmp1, comes from patterns
supplied to _files or _path_files as an argument; I can't see any sign the
double parentheses are used, and the expansion manual says

  A glob subexpression that would normally be taken as glob qualifiers, for
  example (^x), can be forced to be treated as part of the glob pattern by
  doubling the parentheses, in this case producing ((^x)).

Yet we are treating it as if it's a glob expression ($tmp3 is the
new glob qualifier we are trying to insinuate into the list).

Can I simply hold my breath until it goes away?

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author