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

Re: PATCH: Re: expansion



Bart Schaefer wrote:

> On Jun 15,  5:15pm, Sven Wischnowsky wrote:
> } Subject: Re: PATCH: Re: expansion
> }
> } > a(<tab> and you will get '_expand:78: bad pattern: a(' because of the
> } > lack of a closing bracket.
> } 
> } It doesn't anymore, (e) is silent nowadays. By using eval we could get 
> } that, though (that's why I said `careful').
> 
> Something like this:
> 
> 	eval exp\=\( ${${(q)exp}:gs/\\{/{/:gs/\\}/}/} \)
> 
> I haven't figured out where the right place to put that is, though.  I
> tried a couple of different spots in _expand and they both caused brace
> *completion* to stop working, even though the word on the line didn't
> change.

What's going on here? With -f:

  % a='a{b,c}d'
  % b=( ${${(q)a}:gs/\\{/{/:gs/\\}/}/} )
  % echo $b
  a{b,c}d                       # OK
  % setopt braceccl
  % b=( ${${(q)a}:gs/\\{/{/:gs/\\}/}/} )
  % echo $b
  a,d abd acd

Oops. (Yes, works with just `echo ${${(q)a}...}', too.)


Aha! It's the `{' and `}' in the replacements strings. They get
tokenized by the lexer, etc. etc.

Urgh. How... What... Where...

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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