Commit Graph

7 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee c0ef0c8802 tests: Expose the previously private gears.protect_call error handlers.
This will allow the test suits to intercept them instead of adding more
and more exceptions to `run.sh`.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee b4ece0f053 doc: Use an explicit tag for all static functions.
This way their name doesn't get mangle by the broken magic. It will also
eventually allow to `error()` in the template when the implicit
`@function` is used.

This commit also fixes a large number of issues found while
proof-reading everything.
2019-06-08 18:14:13 -04:00
Emmanuel Lepage Vallee ded35502d5 doc: Add a section for utility libraries
Dedicated for the modules extensions developers will need, but that the
general "I only edit rc.lua" user wont.
2019-06-08 18:13:42 -04:00
Uli Schlachter e50fa84f61 gears.protected_call: Automatically detect xpcall features
In Lua 5.1, xpcall() has exactly two arguments: The function to call and
the error handler. Everywhere else, xpcall() passes extra arguments on
to the function to call. This includes LuaJIT, however since LuaJIT sets
_VERSION to "Lua 5.1", so far gears.protected_call used the workaround
for Lua 5.1 here.

This commit switches gears.protected_call to actually test for this
feature instead of just guessing based on _VERSION. Thus, this now also
uses the better code with LuaJIT.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-15 09:25:06 +01:00
Uli Schlachter ed3aac711d Fix traceback in gears.protected_call (#1178)
The traceback should not include the error handler because this is confusing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-22 00:54:08 +02:00
Uli Schlachter 259c4f716f Remove @release @AWESOME_VERSION@ everywhere (#1157)
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-09 22:36:20 +02:00
Uli Schlachter 01f11003d6 Add gears.protected_call
This library is a wrapper around pcall() / xpcall() that prints an error message
via gears.debug.print_error() in case of errors.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-28 12:07:02 +01:00