aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2014-05-28 01:11:09 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2014-05-28 01:11:09 -0400
commit101dd7cacebe7bc062b08320cb6ccfae8c58ad44 (patch)
treee38109118cd5110e7f9de284c1cc23bbf581133c /core
parent3a0af8b2f77401438e833923064ebe10df7230c7 (diff)
downloadtextadept-101dd7cacebe7bc062b08320cb6ccfae8c58ad44.tar.gz
textadept-101dd7cacebe7bc062b08320cb6ccfae8c58ad44.zip
Updated LuaDoc.
Diffstat (limited to 'core')
-rw-r--r--core/.proc.luadoc45
-rw-r--r--core/init.lua37
-rw-r--r--core/lfs_ext.lua1
3 files changed, 36 insertions, 47 deletions
diff --git a/core/.proc.luadoc b/core/.proc.luadoc
deleted file mode 100644
index c10de330..00000000
--- a/core/.proc.luadoc
+++ /dev/null
@@ -1,45 +0,0 @@
--- Copyright 2012-2014 Mitchell mitchell.att.foicica.com. See LICENSE.
--- This is a DUMMY FILE used for making LuaDoc for functions in the proc
--- userdata defined by the lspawn module.
-
----
--- Userdata representing a process created by `spawn()`.
-module('proc')
-
----
--- Returns the status of process *proc*, which is either "running" or
--- "terminated".
--- @param proc A process created by `spawn()`.
--- @return "running" or "terminated"
-function status(proc) end
-
----
--- Blocks until process *proc* finishes.
--- @param proc A process created by `spawn()`.
-function wait(proc) end
-
----
--- Reads and returns stdout from process *proc*, according to string format or
--- number *arg*.
--- Similar to Lua's `io.read()` and blocks for input. *proc* must still be
--- running. If an error occurs while reading, returns `nil`, an error code, and
--- an error message.
--- Ensure any read operations read all stdout available. The stdout callback
--- function passed to `spawn()` will not be called until the stdout buffer is
--- clear.
--- @param proc A process created by `spawn()`.
--- @param arg Optional argument similar to those in Lua's `io.read()`, but "*n"
--- is not supported. The default value is "*l", which reads a line.
--- @return string of bytes read
-function read(proc, arg) end
-
----
--- Writes string input to the stdin of process *proc*.
--- @param proc A process created by `spawn()`.
--- @param ... Standard input for *proc*.
-function write(proc, ...) end
-
----
--- Kills running process *proc*.
--- @param proc A running process created by `spawn()`.
-function kill(proc) end
diff --git a/core/init.lua b/core/init.lua
index ed215679..ca1910cf 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -149,7 +149,8 @@ local timeout
-- The function below comes from the lspawn module.
---
--- Spawns an interactive child process *argv* in a separate thread.
+-- Spawns an interactive child process *argv* in a separate thread, returning
+-- a handle to that process.
-- The terminal version spawns processes in the same thread.
-- @param argv A command line string containing the program's name followed by
-- arguments to pass to it. `PATH` is searched for program names.
@@ -171,8 +172,40 @@ local timeout
-- @usage spawn('lua buffer.filename', nil, print)
-- @usage proc = spawn('lua -e "print(io.read())", nil, print)
-- proc:write('foo\\n')
--- @see _G.proc
-- @class function
-- @name spawn
local spawn
+
+---
+-- Returns the status of process *proc*, which is either "running" or
+-- "terminated".
+-- @return "running" or "terminated"
+function spawn_proc:status() end
+
+---
+-- Blocks until process *proc* finishes.
+function spawn_proc:wait() end
+
+---
+-- Reads and returns stdout from process *proc*, according to string format or
+-- number *arg*.
+-- Similar to Lua's `io.read()` and blocks for input. *proc* must still be
+-- running. If an error occurs while reading, returns `nil`, an error code, and
+-- an error message.
+-- Ensure any read operations read all stdout available. The stdout callback
+-- function passed to `spawn()` will not be called until the stdout buffer is
+-- clear.
+-- @param arg Optional argument similar to those in Lua's `io.read()`, but "*n"
+-- is not supported. The default value is "*l", which reads a line.
+-- @return string of bytes read
+function spawn_proc:read(arg) end
+
+---
+-- Writes string input to the stdin of process *proc*.
+-- @param ... Standard input for *proc*.
+function spawn_proc:write(...) end
+
+---
+-- Kills running process *proc*.
+function spawn_proc:kill() end
]]
diff --git a/core/lfs_ext.lua b/core/lfs_ext.lua
index 3b857477..25bbeb8d 100644
--- a/core/lfs_ext.lua
+++ b/core/lfs_ext.lua
@@ -100,6 +100,7 @@ end
-- returned path is not guaranteed to exist.
-- @param filename The relative or absolute path to a file.
-- @return string absolute path
+-- @name abspath
function lfs.abspath(filename, prefix)
if WIN32 then filename = filename:gsub('/', '\\') end
if not filename:find(not WIN32 and '^/' or '^%a:[/\\]') then