From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27549 invoked by alias); 28 Jan 2016 07:13:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37822 Received: (qmail 376 invoked from network); 28 Jan 2016 07:13:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=6bI2Blsf7k/SfuW+vaF464yonvI7bnFrkMVjX4/KFiA=; b=upIx5MSoHL02QJ/fWAAbR2QI2FGjtuC14TVQTBni1zHdMIpWgzh/3WxWje7f+N42tA 6NdDtsG4xQX472QW0EzjyxbnKBwd7eszV5WG8wrmyv6EECAmklIjSUqJPl2Mwv0EWb70 glGyX4StqRv4v1SSHJ9XRNPC+dtOB6U29yVjw96n+dUj53A63ksCuuxzCUHDyuHczyVN Fy1LuYns+kAEgcz7J/0+m1VV+9YUVw+17SR8/D+UGYVaerfIvqql7O2PYPGZ6fuhNxHV bQIVXv/RS4hbn3hhEedueBc1hLw+dCIuPD9GyO/KS2pmMtWDQnem19VonNbHPN2dmY1/ 1CsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=6bI2Blsf7k/SfuW+vaF464yonvI7bnFrkMVjX4/KFiA=; b=mf/rQz8D5C3P8kwDxLXIOmDJIDF53PsRgpadvG/AVUgY4jhxztGfFEyI+F5BMeyTWf qByW70iZPc7Ufb2IQkWishTf3KLOEPwwUxZVw5/DqXG0Zse4yeRV1qJTT9e4vbvb6vRn 1v/lGazeKh+WLxH3CkK1caWQOJucrH5J/rEGLGHvYyC+bOU9tE266fK0IM5u2J61Z5nW a4gR5emQS6I5EGUTLoyXw782ULkL9QLv0vwsE7EOv1KFfhRZzXSYNvT9MQkpC0FqMQlb uo1cNI9SLeBqpB8tV1CHGOxSP4kQY1jDkUzeYUEWebGpuQ1sDSwGG1y5tCPyhtyezwTs o3FA== X-Gm-Message-State: AG10YOQZC9xh3qts2KtWcraY2e+c0XQ7jMwvzsuietpD4MvEarv8qQj6sLfiHTabq5HmG/5ePtNlSJuAkXJlpA== X-Received: by 10.25.151.9 with SMTP id z9mr452298lfd.72.1453965230891; Wed, 27 Jan 2016 23:13:50 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <160127223847.ZM17546@torch.brasslantern.com> References: <160122173705.ZM11491@torch.brasslantern.com> <160123093602.ZM14454@torch.brasslantern.com> <160123112004.ZM14739@torch.brasslantern.com> <160123120055.ZM14828@torch.brasslantern.com> <20160126225010.GA15958@tarsus.local2> <160126203458.ZM2800@torch.brasslantern.com> <160127223847.ZM17546@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Thu, 28 Jan 2016 08:13:31 +0100 Message-ID: Subject: Re: Proof of concept mainstream plugin manager To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On 28 January 2016 at 07:38, Bart Schaefer 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