Re: [textadept] Loading a lua script

From: mitchell <>
Date: Sun, 23 Jan 2011 14:04:54 -0500 (EST)


> inspired by the change [1] in args.lua to the help text I wrote a
> command line argument to use Textadept as a Lua interpreter. The
> luatex interpreter has a switch like this and I thought something like
> this would be useful, especially on Windows where it's not a one-liner
> to install Lua.
> <snip>
> A script "test.lua" can now be run from the command line with
> textadept --luaonly test.lua

Cool! This can be rather useful.

> Does anyone know how I could sandbox this that Textadept's modules
> would not be part of the script's environment? I read a bit about
> sandboxing and setfenv but haven't found a simple way yet. If this is
> possible one could also use Textadept instead of the external Lua
> interpreter in the run commands (if there is no Lua installed).

I'm not sure that setfenv would work. Other than the obvious '[table] =
nil', I don't know how this would be done since most of the initial state
is populated in C.

Received on Sun 23 Jan 2011 - 14:04:54 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:59:06 EST