Subject: Re: Proof of concept mainstream plugin manager
From: Sebastian Gniazdowski <[email-masked]>
To: Bart Schaefer <[email-masked]>
Cc: Zsh hackers list <[email-masked]>
Date: Thu, 28 Jan 2016 08:13:31 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On 28 January 2016 at 07:38, Bart Schaefer <[email-masked]> wrote:
> Oh.  Yes, you need to pass empty string there if there are no options,
> because _reload_and_run interprets its first 3 arguments positionally
> and all are required to be present.  Sorry about that.
>
> So if you want to use the assignment form, you need
>
> functions[$func]="_reload_and_run ${(q)PLUGIN_DIR} ${${(q)opts[@]}} $func "'"$@"'
>
> The ${(qq)opts[@]} quotes every element separately, and then the outer
> ${...} compbines the result into a single string again.

I still get the same behavior

> Back on the first hand, I suppose if $func somehow contains a semicolon
> or some globbing characters, rather than just spaces, then you should
> quote those.  So yes, ${(q)func} is better.

Did one test. There is one simple plugin calc, which does:

function =
{
  echo "$@" | bc -l
}

If I convert this into autoload function it doesn't break without (q)
in ${(q)func}. That said, I'll better stick with (q).

Best regards,
Sebastian Gniazdowski