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

Re: _expand doesn't do brace expansion?



On Jun 15, 11:20am, Sven Wischnowsky wrote:
} Subject: Re: _expand doesn't do brace expansion?
}
} Oh, didn't everyone know that?

_complete manages to complete inside braces; why does the code that
understands braces stop taking them apart when there's a closed pair?
AFAICT, no completion works at all once any close brace is in place,
even if that's within an outer set of braces, e.g.

zagzig[52] ls Functions/({Mi<TAB>
zagzig[52] ls Functions/{{Misc/<,TAB>
zagzig[52] ls Functions/{{Misc,
Completing file
README.zftp   Zftp/         Prompts/      CVS/                      
Makefile.in   Zle/          Misc/                                 
zagzig[52] ls Functions/{{Misc,P<TAB>
zagzig[52] ls Functions/{{Misc,Prompts/<},TAB>
zagzig[52] ls Functions/{{Misc,Prompts},
Completing `file' or `corrections'
(BEEP)

}   % a='a{x,y}b'
}   % echo ${(e)a}
}   a{x,y}b

That is kinda grody.

It ought to be possible to turn 'a{x,y}b' into 'a${^=:-x y}b' and then
use ${(e)...} on that; but dang it's tough to match a curly brace inside
a ${var/pat/rep} expression without causing a parse error.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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