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

Re: destructive list-expand

On May 14, 10:30pm, Clint Adams wrote:
} If I type a command such as
} echo ${(M)${(f)"$(<listofthings)"}:#*subthing*}
} Then invoke list-expand, the appropriate expansion will be displayed,
} and the command line will change to
} echo ${(M)${(f)$(<listofthings)}:#*subthing*}

Hmm; this is interesting.

list-expand (C-x g) doesn't use the new completion system, and exhibits
the above-described behavior at least as far back as 3.0.6 and probably

_list_expansions (C-x d) from _expand_word should be the new completion
system equivalent, but it doesn't appear to work at all. Even just plain
_expand_word (C-x e) beeps at me, but old-style expand-word properly
expands to everything listed by list-expand.

It's a bit hard to tell from the _complete_debug trace, but it looks as
if the double quotes have already been stripped from $PREFIX by the time
_expand is called -- e.g.

: _expand:24:else; word=${(M)${(f)$(<listofthings)}:#*subthing*} 

and then a bit later

: _expand:60:then; exp=: _expand:60:then cmdsubst; print -l CVS ChangeLog
ChangeLog-Release ChangeLog.3.0 Completion Config Doc Etc Functions INSTALL
LICENCE META-FAQ Makefile.in Misc README Src StartupFiles Test Util acconfig.h
aclocal.m4 aczsh.m4 config.guess config.h.in config.log config.sub configure
configure.in full.diff install-sh mkinstalldirs stamp-h.in
: _expand:60:then; exp=( ) 

I don't quite see where the quotes are getting stripped off, unless it's
actually get_comp_string() that's at fault.  (Somebody (hi, Sven) should
update the comment around line 1028 of zle_tricky.c in any event.)

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