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

Re: Minor expansion problem



On Sep 25,  2:09pm, Peter Stephenson wrote:
}
} Can anyone would explain why I get
} 
} % echo foo and, just to be different, bar >foo
} % echo `cat foo`<TAB>
}      ->foo\ and,\ just\ to\ be\ different,\ bar.
} 
} with the _expand completer (and complete-word bound to TAB)

It's in part because you used backticks.  Expanding $(...) doesn't put
in backslashes, but expanding `...` does.  This appears to be happening
because the ${(e)exp} at _expand line 83 returns one word for `...` but
an array for $(...).

} but what I expect, i.e. no backslashes, with the _expand_word widget?

Hrm, I get backslashes in both cases.  Are you sure you're using the
_expand_word widget (^Xe) and not the builtin expand-word (^X*) ?

} I've stared at my styles but can't see what might be causing it.

The only style that I can see getting involved here is the "glob"
style, in contexts :completion:expand:* and :completion:expand-word:*.
See _expand line 98.

-- 
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