Integrated Lua scripting. More...
#include "config.h"#include <lauxlib.h>#include <lua.h>#include <lualib.h>#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include "mutt/lib.h"#include "config/lib.h"#include "core/lib.h"#include "mutt_lua.h"#include "parse/lib.h"#include "muttlib.h"#include "version.h"
Include dependency graph for mutt_lua.c:Go to the source code of this file.
Macros | |
| #define | LUA_COMPAT_ALL |
| #define | LUA_COMPAT_5_1 |
Functions | |
| static int | handle_panic (lua_State *l) |
| Handle a panic in the Lua interpreter. | |
| static int | handle_error (lua_State *l) |
| Handle an error in the Lua interpreter. | |
| static int | lua_mutt_call (lua_State *l) |
| Call a NeoMutt command by name. | |
| static int | lua_mutt_set (lua_State *l) |
| Set a NeoMutt variable. | |
| static int | lua_mutt_get (lua_State *l) |
| Get a NeoMutt variable. | |
| static int | lua_mutt_enter (lua_State *l) |
| Execute NeoMutt config from Lua. | |
| static int | lua_mutt_message (lua_State *l) |
| Display a message in NeoMutt. | |
| static int | lua_mutt_error (lua_State *l) |
| Display an error in NeoMutt. | |
| static void | lua_expose_command (lua_State *l, const struct Command *cmd) |
| Expose a NeoMutt command to the Lua interpreter. | |
| static int | luaopen_mutt_decl (lua_State *l) |
| Declare some NeoMutt types to the Lua interpreter. | |
| static void | luaopen_mutt (lua_State *l) |
| Expose a 'Mutt' object to the Lua interpreter. | |
| static bool | lua_init (lua_State **l) |
| Initialise a Lua State. | |
| void | mutt_lua_init (void) |
| Setup feature commands. | |
| enum CommandResult | mutt_lua_parse (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
| Parse the 'lua' command - Implements Command::parse() -. | |
| enum CommandResult | mutt_lua_source_file (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
| Parse the 'lua-source' command - Implements Command::parse() -. | |
Variables | |
| static lua_State * | LuaState = NULL |
| Global Lua State. | |
| static const struct Command | LuaCommands [] |
| List of NeoMutt commands to register. | |
| static const luaL_Reg | LuaMuttCommands [] |
| List of Lua commands to register. | |
Integrated Lua scripting.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file mutt_lua.c.
| #define LUA_COMPAT_ALL |
Definition at line 35 of file mutt_lua.c.
| #define LUA_COMPAT_5_1 |
Definition at line 38 of file mutt_lua.c.
|
static |
Handle a panic in the Lua interpreter.
| l | Lua State |
| -1 | Always |
Definition at line 75 of file mutt_lua.c.
Here is the caller graph for this function:
|
static |
Handle an error in the Lua interpreter.
| l | Lua State |
| -1 | Always |
Definition at line 88 of file mutt_lua.c.
Here is the caller graph for this function:
|
static |
Call a NeoMutt command by name.
| l | Lua State |
| >=0 | Success |
| -1 | Error |
Definition at line 102 of file mutt_lua.c.
Here is the call graph for this function:
|
static |
Set a NeoMutt variable.
| l | Lua State |
| 0 | Success |
| -1 | Error |
Definition at line 156 of file mutt_lua.c.
Here is the call graph for this function:
|
static |
Get a NeoMutt variable.
| l | Lua State |
| 1 | Success |
| -1 | Error |
Definition at line 245 of file mutt_lua.c.
Here is the call graph for this function:
|
static |
Execute NeoMutt config from Lua.
| l | Lua State |
| >=0 | Success |
| -1 | Error |
Definition at line 307 of file mutt_lua.c.
Here is the call graph for this function:
|
static |
Display a message in NeoMutt.
| l | Lua State |
| 0 | Always |
Definition at line 338 of file mutt_lua.c.
|
static |
Display an error in NeoMutt.
| l | Lua State |
| 0 | Always |
Definition at line 352 of file mutt_lua.c.
|
static |
Expose a NeoMutt command to the Lua interpreter.
Definition at line 366 of file mutt_lua.c.
Here is the caller graph for this function:
|
static |
Declare some NeoMutt types to the Lua interpreter.
| l | Lua State |
| 1 | Always |
Definition at line 401 of file mutt_lua.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Expose a 'Mutt' object to the Lua interpreter.
| l | Lua State |
Definition at line 422 of file mutt_lua.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Initialise a Lua State.
| [out] | l | Lua State |
| true | Successful |
Definition at line 441 of file mutt_lua.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_lua_init | ( | void | ) |
Setup feature commands.
Definition at line 469 of file mutt_lua.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Global Lua State.
Definition at line 57 of file mutt_lua.c.
|
static |
List of NeoMutt commands to register.
Definition at line 62 of file mutt_lua.c.
|
static |
List of Lua commands to register.
In NeoMutt, run:
‘:lua mutt.message('hello’)`
and it will call lua_mutt_message()
Definition at line 383 of file mutt_lua.c.