Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: SH_GLOB influence on a script and on an autoload function
- X-seq: zsh-workers 38660
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: SH_GLOB influence on a script and on an autoload function
- Date: Sat, 11 Jun 2016 10:14:12 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=n6yWE6viL3tBFvWB0j75okGMM02dUJjW4o+XHbCw2zk=; b=ujnJ+AcR9iofsZPPDex1wA1iE7hA4kGvIAvVp+Ga5QAq/85jJ62ATqkvzdcv9udVL2 axubBVcFo/Y4ZoQmNmJJy99Rc0yOU0XrAJht70XukW71zKj1MgxVN28EsQhUB+XzXVjH /jgqPjmYG1DGfgdVtT30CNtiDh35OTCbnLeKn3btAo1jIyv6sCMnmtMkaENAo0H2J9c6 3IZTOE07LMIZYZcKkCzxOlcFGffYCYeWXHfcEh0jYzeryXJZ5E/VVHj14FjjzQuQcdVK f6xv78VJaTtiWTDLg+eKli1FX8ZcBG5QpcS0GQl9ntrcJLg3tlRMyA08zdQ7UnFfU0ya aM5w==
- In-reply-to: <CAKc7PVBSCgG4Y87L_PzCEWDk=-cQLFmLxwps_rfvUUuhA-Np+w@mail.gmail.com>
- 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: <CAKc7PVBSCgG4Y87L_PzCEWDk=-cQLFmLxwps_rfvUUuhA-Np+w@mail.gmail.com>
On Jun 11, 7:11am, Sebastian Gniazdowski wrote:
}
} Below is a simple script (save to file rtest1) that works well despite
} SH_GLOB should or could stop the pattern from parsing. The same
} doesn't work for autoload.
A script is executed line by line as it is parsed. An autoloaded function
is fully parsed first, then executed. Hence in the script, the "emulate"
command resets the parsing rules before the expression is encountered.
This is one of the drawbacks to attempting to accurately emulate parsing
rules that are inherently contradictory.
} setopt shglob
} FPATH=$FPATH:`pwd`
} autoload rtest1
} rtest1
}
} Probably no workaround for this?
In "recent" zsh (since roughly 2009) you can do this:
emulate zsh -c 'autoload rtest1'
but of course you have to know a priori what emulation mode the function
is going to want.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author