Subject: Re: bufferwords() lexes a subshell in a shortloop repeat as a string
From: Peter Stephenson <[email-masked]>
To: [email-masked]
Date: Mon, 18 Jan 2016 10:45:48 +0000
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Mon, 18 Jan 2016 02:25:58 +0000
Daniel Shahaf <[email-masked]> wrote:
> Even after reading your other reply, I still don't understand what
> distinction you're trying to draw here, what case you say isn't expected
> to work.  Could you clarify, please?

No, the whole point is I *can't* say what case isn't going to work, just
that there will be a vast heap of them if you attempt to split arbitrary
strings and prod the result in enough detail..

The underlying splitting is executing the raw lexer with various
squiggles on top to fix up some special cases (but only some).  It's
doing it in a way which is sort-of helpful to completion, but it's doing
it thoroughly inconsistently, given that in the case of (z) all it's
been told is "here, have this string which has got some bits of command
line in".  So you just have to see what actually works and work round
it.  (Or, of course, rewrite the whole thing, which would be nice, but I
don't think is ever going to happen.)

There is some special casing in bufferwords() for loops, though, so
maybe the case you want isn't far off working.

pws