diff options
author | 2014-03-26 10:15:53 -0400 | |
---|---|---|
committer | 2014-03-26 10:15:53 -0400 | |
commit | f65b2b2a66f05b20010256ca1d81cc3252ea1471 (patch) | |
tree | c7ee3cd4753a9e8a73f9e9d3e8a45f96eb5b36c7 /core/init.lua | |
parent | 6304010d93b3cfe43e246dbb49c60d147a366b1b (diff) |
Include my new "lspawn" module by default for spawning processes.
The `textadept.run` module now uses `spawn()` instead of `io.popen()`.
This module replaces the dependency on winapi. Removed experimental
`io.popen()` and `os.execute()` hooks. They may be re-implemented later using
`spawn()`.
Diffstat (limited to 'core/init.lua')
-rw-r--r-- | core/init.lua | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/core/init.lua b/core/init.lua index 6470f689..df4a5e38 100644 --- a/core/init.lua +++ b/core/init.lua @@ -122,4 +122,33 @@ local reset -- @class function -- @name timeout local timeout + +-- The function below comes from the lspawn module. + +--- +-- Spawns an interactive child process *argv* in a separate thread with the help +-- of GLib. +-- @param argv A UTF-8-encoded command line string containing the program's name +-- followed by arguments to pass to it. `PATH` is searched for program names. +-- @param working_dir The child's UTF-8 current working directory (cwd) or `nil` +-- to inherit the parent's. +-- @param stdout_cb A Lua function that accepts a string parameter for a block +-- of standard output read from the child. Stdout is read asynchronously in +-- 1KB or 0.5KB blocks (depending on the platform), or however much data is +-- available at the time. All text is encoded in `_CHARSET`. +-- @param stderr_cb A Lua function that accepts a string parameter for a block +-- of standard error read from the child. Stderr is read asynchronously in 1KB +-- or 0.5kB blocks (depending on the platform), or however much data is +-- available at the time. All text is encoded in `_CHARSET`. +-- @param exit_cb A Lua function that is called when the child process finishes. +-- The child's exit status is passed. +-- @return proc +-- @usage spawn('lua buffer.filename', nil, print) +-- @usage proc = spawn('lua -e "print(io.read())", nil, print) +-- proc:write('foo\\n') +-- @see _G._CHARSET +-- @see _G.proc +-- @class function +-- @name spawn +local spawn ]] |