Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Surprising effect of fun() { local FPATH=...; autoload -X }, and a bug
- X-seq: zsh-workers 39458
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: Surprising effect of fun() { local FPATH=...; autoload -X }, and a bug
- Date: Tue, 27 Sep 2016 09:54:48 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- 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-transfer-encoding; bh=u4nbqSJdeebRROmFuk66rwC9wG6unAxRYrbtt3q/z74=; b=m2+iegEls0vACxT9/+HupoeTZ+uZY+KnlEMZEG8+SvfyBpbpvej8CDEL6xr2VJLGhi vw97g3GsH0kHv+N9Ix9ACAuz5++emhR0FXmIZttaiKVcM/pMQliVhGrZkCj+40n9ExQ8 PROYZ5wiILA0PVAMWldNt1dJAOd5pgOq9GzLJ5uGo3ZknVJQauZm7kthT9vk/3YV7L3Q +i3SvMuFnO2mw+A8AdaJDOo8t4OReShS4ArQuFPPHfzJPLaya5oZV8MS3NDzzZrpiWcG /Y44sWB2LCsiP+Cvp/5QjpGFX9FsM3oVu8LTQwtgmDCOv64Bfz5DjvxpuClP4HnIu9Zu GuAw==
- In-reply-to: <20160927070527.GA20829@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCXq6jQe2gF-Hb4UFBx7UXxRE=3_8Z2Oyq-H6d0LoNLAA@mail.gmail.com> <20160927070527.GA20829@fujitsu.shahaf.local2>
On 27 September 2016 at 09:05, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Sebastian Gniazdowski wrote on Tue, Sep 27, 2016 at 00:07:37 +0200:
>> eval "function $func {
>> local FPATH="$PLUGIN_DIR":"${FPATH}"
>> builtin autoload -X ${opts[*]}
>> }"
>
> The " signs in the first line of the function body need to be escaped.
>
> The parameter expansions $foo need to be escaped, some as \$foo and
> others as ${(q)foo}.
As we discussed on IRC, the final version is like following – quoting
in 4 new places:
eval "function ${(q)func} {
local FPATH=${(qqq)PLUGIN_DIR}:${(qqq)FPATH}
builtin autoload -X ${(q-)opts[@]}
}"
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author