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

Re: PATCH: bug in ${(z)...} with newlines



On Thu, Jun 17, 2010 at 4:50 AM, Peter Stephenson
<Peter.Stephenson@xxxxxxx> wrote:
> On Wed, 16 Jun 2010 15:13:29 -0700
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> BTW there are uses of (z) in Functions/Zle/ that may very well be
>> relying on the last ten years of behavior, including in
>> match-word-context and match-words-by-style and even which-command.
>
> Several of those are mine, which definitely don't rely on getting something
> other than split arguments.  I've been assuming up to now that as long
> as the words can be parsed (there are odd cases with unquoted
> parentheses and the like) there should be no gotchas, and in particular
> that if you've input quoted words separated by white space you should
> just get the words back (hence the current thread).

There are a bunch of other potential gotchas with (z) from that
standpoint, such as special treatment of redirection operators.  If
what you really want is purely quotation parsing, it may be better to
add something new rather than modify (z).

Also it is helpful to have something that can distinguish a newline
that would be parsed as a command separator from one that
shell-syntactically is merely whitespace.  That was Felix's original
problem all those years ago.



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