NeoMutt
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
mutt_lua.c File Reference

Integrated Lua scripting. More...

#include "config.h"
#include <lauxlib.h>
#include <limits.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 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.
 

Detailed Description

Integrated Lua scripting.

Authors
  • Richard Russon
  • Bernard Pratz

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.

Macro Definition Documentation

◆ LUA_COMPAT_ALL

#define LUA_COMPAT_ALL

Definition at line 31 of file mutt_lua.c.

◆ LUA_COMPAT_5_1

#define LUA_COMPAT_5_1

Definition at line 34 of file mutt_lua.c.

Function Documentation

◆ handle_panic()

static int handle_panic ( lua_State *  l)
static

Handle a panic in the Lua interpreter.

Parameters
lLua State
Return values
-1Always

Definition at line 70 of file mutt_lua.c.

71{
72 mutt_debug(LL_DEBUG1, "lua runtime panic: %s\n", lua_tostring(l, -1));
73 mutt_error("Lua runtime panic: %s", lua_tostring(l, -1));
74 lua_pop(l, 1);
75 return -1;
76}
#define mutt_error(...)
Definition: logging2.h:92
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
@ LL_DEBUG1
Log at debug level 1.
Definition: logging2.h:43
+ Here is the caller graph for this function:

◆ handle_error()

static int handle_error ( lua_State *  l)
static

Handle an error in the Lua interpreter.

Parameters
lLua State
Return values
-1Always

Definition at line 83 of file mutt_lua.c.

84{
85 mutt_debug(LL_DEBUG1, "lua runtime error: %s\n", lua_tostring(l, -1));
86 mutt_error("Lua runtime error: %s", lua_tostring(l, -1));
87 lua_pop(l, 1);
88 return -1;
89}
+ Here is the caller graph for this function:

◆ lua_mutt_call()

static int lua_mutt_call ( lua_State *  l)
static

Call a NeoMutt command by name.

Parameters
lLua State
Return values
>=0Success
-1Error

Definition at line 97 of file mutt_lua.c.

98{
99 mutt_debug(LL_DEBUG2, " * lua_mutt_call()\n");
100 struct Buffer *err = buf_pool_get();
101 struct Buffer *token = buf_pool_get();
102 char buf[1024] = { 0 };
103 const struct Command *cmd = NULL;
104 int rc = 0;
105
106 if (lua_gettop(l) == 0)
107 {
108 luaL_error(l, "Error command argument required.");
109 return -1;
110 }
111
112 cmd = command_get(lua_tostring(l, 1));
113 if (!cmd)
114 {
115 luaL_error(l, "Error command %s not found.", lua_tostring(l, 1));
116 return -1;
117 }
118
119 for (int i = 2; i <= lua_gettop(l); i++)
120 {
121 const char *s = lua_tostring(l, i);
122 mutt_strn_cat(buf, sizeof(buf), s, mutt_str_len(s));
123 mutt_strn_cat(buf, sizeof(buf), " ", 1);
124 }
125
126 struct Buffer expn = buf_make(0);
127 expn.data = buf;
128 expn.dptr = buf;
129 expn.dsize = mutt_str_len(buf);
130
131 if (cmd->parse(token, &expn, cmd->data, err))
132 {
133 luaL_error(l, "NeoMutt error: %s", buf_string(err));
134 rc = -1;
135 }
136 else
137 {
138 if (!lua_pushstring(l, buf_string(err)))
139 handle_error(l);
140 else
141 rc++;
142 }
143
144 buf_pool_release(&token);
145 buf_pool_release(&err);
146 return rc;
147}
struct Buffer buf_make(size_t size)
Make a new buffer on the stack.
Definition: buffer.c:70
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:93
struct Command * command_get(const char *s)
Get a Command by its name.
Definition: command.c:87
@ LL_DEBUG2
Log at debug level 2.
Definition: logging2.h:44
char * mutt_strn_cat(char *d, size_t l, const char *s, size_t sl)
Concatenate two strings.
Definition: string.c:295
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:568
static int handle_error(lua_State *l)
Handle an error in the Lua interpreter.
Definition: mutt_lua.c:83
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:81
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:94
String manipulation buffer.
Definition: buffer.h:34
char * dptr
Current read/write position.
Definition: buffer.h:36
size_t dsize
Length of data.
Definition: buffer.h:37
char * data
Pointer to data.
Definition: buffer.h:35
enum CommandResult(* parse)(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Definition: command.h:65
intptr_t data
Data or flags to pass to the command.
Definition: command.h:67
+ Here is the call graph for this function:

◆ lua_mutt_set()

static int lua_mutt_set ( lua_State *  l)
static

Set a NeoMutt variable.

Parameters
lLua State
Return values
0Success
-1Error

Definition at line 155 of file mutt_lua.c.

156{
157 const char *param = lua_tostring(l, -2);
158 mutt_debug(LL_DEBUG2, " * lua_mutt_set(%s)\n", param);
159
160 struct Buffer err = buf_make(256);
161 struct HashElem *he = cs_subset_lookup(NeoMutt->sub, param);
162 if (!he)
163 {
164 // In case it is a my_var, we have to create it
165 if (mutt_str_startswith(param, "my_"))
166 {
167 struct ConfigDef my_cdef = { 0 };
168 my_cdef.name = param;
169 my_cdef.type = DT_MYVAR;
170 he = cs_create_variable(NeoMutt->sub->cs, &my_cdef, &err);
171 if (!he)
172 return -1;
173 }
174 else
175 {
176 luaL_error(l, "NeoMutt parameter not found %s", param);
177 return -1;
178 }
179 }
180
181 struct ConfigDef *cdef = he->data;
182
183 int rc = 0;
184
185 switch (DTYPE(cdef->type))
186 {
187 case DT_ADDRESS:
188 case DT_ENUM:
189 case DT_MBTABLE:
190 case DT_MYVAR:
191 case DT_PATH:
192 case DT_REGEX:
193 case DT_SLIST:
194 case DT_SORT:
195 case DT_STRING:
196 {
197 const char *value = lua_tostring(l, -1);
198 size_t val_size = lua_rawlen(l, -1);
199 struct Buffer value_buf = buf_make(val_size);
200 buf_strcpy_n(&value_buf, value, val_size);
201 if (DTYPE(he->type) == DT_PATH)
202 buf_expand_path(&value_buf);
203
204 int rv = cs_subset_he_string_set(NeoMutt->sub, he, value_buf.data, &err);
205 buf_dealloc(&value_buf);
206 if (CSR_RESULT(rv) != CSR_SUCCESS)
207 rc = -1;
208 break;
209 }
210 case DT_NUMBER:
211 case DT_QUAD:
212 {
213 const intptr_t value = lua_tointeger(l, -1);
214 int rv = cs_subset_he_native_set(NeoMutt->sub, he, value, &err);
215 if (CSR_RESULT(rv) != CSR_SUCCESS)
216 rc = -1;
217 break;
218 }
219 case DT_BOOL:
220 {
221 const intptr_t value = lua_toboolean(l, -1);
222 int rv = cs_subset_he_native_set(NeoMutt->sub, he, value, &err);
223 if (CSR_RESULT(rv) != CSR_SUCCESS)
224 rc = -1;
225 break;
226 }
227 default:
228 luaL_error(l, "Unsupported NeoMutt parameter type %d for %s", DTYPE(cdef->type), param);
229 rc = -1;
230 break;
231 }
232
233 buf_dealloc(&err);
234 return rc;
235}
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:389
size_t buf_strcpy_n(struct Buffer *buf, const char *s, size_t len)
Copy a string into a Buffer.
Definition: buffer.c:422
struct HashElem * cs_create_variable(const struct ConfigSet *cs, struct ConfigDef *cdef, struct Buffer *err)
Create and register one config item.
Definition: set.c:317
#define CSR_RESULT(x)
Definition: set.h:52
#define CSR_SUCCESS
Action completed successfully.
Definition: set.h:35
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition: string.c:228
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Definition: muttlib.c:335
Definition: set.h:64
const char * name
User-visible name.
Definition: set.h:65
uint32_t type
Variable type, e.g. DT_STRING.
Definition: set.h:66
struct ConfigSet * cs
Parent ConfigSet.
Definition: subset.h:51
The item stored in a Hash Table.
Definition: hash.h:44
int type
Type of data stored in Hash Table, e.g. DT_STRING.
Definition: hash.h:45
void * data
User-supplied data.
Definition: hash.h:47
Container for Accounts, Notifications.
Definition: neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:45
int cs_subset_he_native_set(const struct ConfigSubset *sub, struct HashElem *he, intptr_t value, struct Buffer *err)
Natively set the value of a HashElem config item.
Definition: subset.c:282
int cs_subset_he_string_set(const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err)
Set a config item by string.
Definition: subset.c:385
struct HashElem * cs_subset_lookup(const struct ConfigSubset *sub, const char *name)
Find an inherited config item.
Definition: subset.c:178
#define DT_SORT
sorting methods
Definition: types.h:40
#define DTYPE(x)
Mask for the Data Type.
Definition: types.h:45
#define DT_SLIST
a list of strings
Definition: types.h:39
#define DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition: types.h:37
#define DT_BOOL
boolean option
Definition: types.h:30
#define DT_MYVAR
a user-defined variable (my_foo)
Definition: types.h:43
#define DT_PATH
a path to a file/directory
Definition: types.h:36
#define DT_STRING
a string
Definition: types.h:41
#define DT_ENUM
an enumeration
Definition: types.h:31
#define DT_ADDRESS
e-mail address
Definition: types.h:29
#define DT_REGEX
regular expressions
Definition: types.h:38
#define DT_MBTABLE
multibyte char table
Definition: types.h:34
#define DT_NUMBER
a number
Definition: types.h:35
+ Here is the call graph for this function:

◆ lua_mutt_get()

static int lua_mutt_get ( lua_State *  l)
static

Get a NeoMutt variable.

Parameters
lLua State
Return values
1Success
-1Error

Definition at line 243 of file mutt_lua.c.

244{
245 const char *param = lua_tostring(l, -1);
246 mutt_debug(LL_DEBUG2, " * lua_mutt_get(%s)\n", param);
247
248 struct HashElem *he = cs_subset_lookup(NeoMutt->sub, param);
249 if (!he)
250 {
251 mutt_debug(LL_DEBUG2, " * error\n");
252 luaL_error(l, "NeoMutt parameter not found %s", param);
253 return -1;
254 }
255
256 struct ConfigDef *cdef = he->data;
257
258 switch (DTYPE(cdef->type))
259 {
260 case DT_ADDRESS:
261 case DT_ENUM:
262 case DT_MBTABLE:
263 case DT_MYVAR:
264 case DT_REGEX:
265 case DT_SLIST:
266 case DT_SORT:
267 case DT_STRING:
268 {
269 struct Buffer value = buf_make(256);
270 int rc = cs_subset_he_string_get(NeoMutt->sub, he, &value);
271 if (CSR_RESULT(rc) != CSR_SUCCESS)
272 {
273 buf_dealloc(&value);
274 return -1;
275 }
276
277 struct Buffer escaped = buf_make(256);
278 escape_string(&escaped, value.data);
279 lua_pushstring(l, escaped.data);
280 buf_dealloc(&value);
281 buf_dealloc(&escaped);
282 return 1;
283 }
284 case DT_QUAD:
285 lua_pushinteger(l, (unsigned char) cdef->var);
286 return 1;
287 case DT_NUMBER:
288 lua_pushinteger(l, (signed short) cdef->var);
289 return 1;
290 case DT_BOOL:
291 lua_pushboolean(l, (bool) cdef->var);
292 return 1;
293 default:
294 luaL_error(l, "NeoMutt parameter type %d unknown for %s", cdef->type, param);
295 return -1;
296 }
297}
size_t escape_string(struct Buffer *buf, const char *src)
Write a string to a buffer, escaping special characters.
Definition: dump.c:46
intptr_t var
Storage for the variable.
Definition: set.h:85
int cs_subset_he_string_get(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *result)
Get a config item as a string.
Definition: subset.c:353
+ Here is the call graph for this function:

◆ lua_mutt_enter()

static int lua_mutt_enter ( lua_State *  l)
static

Execute NeoMutt config from Lua.

Parameters
lLua State
Return values
>=0Success
-1Error

Definition at line 305 of file mutt_lua.c.

306{
307 mutt_debug(LL_DEBUG2, " * lua_mutt_enter()\n");
308 struct Buffer *err = buf_pool_get();
309 char *buf = mutt_str_dup(lua_tostring(l, -1));
310 int rc = 0;
311
312 if (parse_rc_line(buf, err))
313 {
314 luaL_error(l, "NeoMutt error: %s", buf_string(err));
315 rc = -1;
316 }
317 else
318 {
319 if (!lua_pushstring(l, buf_string(err)))
320 handle_error(l);
321 else
322 rc++;
323 }
324
325 FREE(&buf);
326 buf_pool_release(&err);
327
328 return rc;
329}
#define FREE(x)
Definition: memory.h:45
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:251
enum CommandResult parse_rc_line(const char *line, struct Buffer *err)
Parse a line of user config.
Definition: rc.c:104
+ Here is the call graph for this function:

◆ lua_mutt_message()

static int lua_mutt_message ( lua_State *  l)
static

Display a message in Neomutt.

Parameters
lLua State
Return values
0Always

Definition at line 336 of file mutt_lua.c.

337{
338 mutt_debug(LL_DEBUG2, " * lua_mutt_message()\n");
339 const char *msg = lua_tostring(l, -1);
340 if (msg)
341 mutt_message("%s", msg);
342 return 0;
343}
#define mutt_message(...)
Definition: logging2.h:91

◆ lua_mutt_error()

static int lua_mutt_error ( lua_State *  l)
static

Display an error in Neomutt.

Parameters
lLua State
Return values
0Always

Definition at line 350 of file mutt_lua.c.

351{
352 mutt_debug(LL_DEBUG2, " * lua_mutt_error()\n");
353 const char *msg = lua_tostring(l, -1);
354 if (msg)
355 mutt_error("%s", msg);
356 return 0;
357}

◆ lua_expose_command()

static void lua_expose_command ( lua_State *  l,
const struct Command cmd 
)
static

Expose a NeoMutt command to the Lua interpreter.

Parameters
lLua state
cmdNeoMutt Command

Definition at line 364 of file mutt_lua.c.

365{
366 char buf[1024] = { 0 };
367 snprintf(buf, sizeof(buf), "mutt.command.%s = function (...); mutt.call('%s', ...); end",
368 cmd->name, cmd->name);
369 (void) luaL_dostring(l, buf);
370}
const char * name
Name of the command.
Definition: command.h:52
+ Here is the caller graph for this function:

◆ luaopen_mutt_decl()

static int luaopen_mutt_decl ( lua_State *  l)
static

Declare some NeoMutt types to the Lua interpreter.

Parameters
lLua State
Return values
1Always

Definition at line 399 of file mutt_lua.c.

400{
401 mutt_debug(LL_DEBUG2, " * luaopen_mutt()\n");
402 luaL_newlib(l, LuaMuttCommands);
403 int lib_idx = lua_gettop(l);
404
405 // clang-format off
406 lua_pushstring(l, "VERSION"); lua_pushstring(l, mutt_make_version()); lua_settable(l, lib_idx);;
407 lua_pushstring(l, "QUAD_YES"); lua_pushinteger(l, MUTT_YES); lua_settable(l, lib_idx);;
408 lua_pushstring(l, "QUAD_NO"); lua_pushinteger(l, MUTT_NO); lua_settable(l, lib_idx);;
409 lua_pushstring(l, "QUAD_ASKYES"); lua_pushinteger(l, MUTT_ASKYES); lua_settable(l, lib_idx);;
410 lua_pushstring(l, "QUAD_ASKNO"); lua_pushinteger(l, MUTT_ASKNO); lua_settable(l, lib_idx);;
411 // clang-format on
412
413 return 1;
414}
static const luaL_Reg LuaMuttCommands[]
List of Lua commands to register.
Definition: mutt_lua.c:381
const char * mutt_make_version(void)
Generate the NeoMutt version string.
Definition: muttlib.c:1443
@ MUTT_ASKNO
Ask the user, defaulting to 'No'.
Definition: quad.h:40
@ MUTT_NO
User answered 'No', or assume 'No'.
Definition: quad.h:38
@ MUTT_ASKYES
Ask the user, defaulting to 'Yes'.
Definition: quad.h:41
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition: quad.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ luaopen_mutt()

static void luaopen_mutt ( lua_State *  l)
static

Expose a 'Mutt' object to the Lua interpreter.

Parameters
lLua State

Definition at line 420 of file mutt_lua.c.

421{
422 luaL_requiref(l, "mutt", luaopen_mutt_decl, 1);
423 (void) luaL_dostring(l, "mutt.command = {}");
424
425 struct Command *c = NULL;
426 for (size_t i = 0, size = commands_array(&c); i < size; i++)
427 {
428 lua_expose_command(l, &c[i]);
429 }
430}
size_t commands_array(struct Command **first)
Get Commands array.
Definition: command.c:75
static void lua_expose_command(lua_State *l, const struct Command *cmd)
Expose a NeoMutt command to the Lua interpreter.
Definition: mutt_lua.c:364
static int luaopen_mutt_decl(lua_State *l)
Declare some NeoMutt types to the Lua interpreter.
Definition: mutt_lua.c:399
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lua_init()

static bool lua_init ( lua_State **  l)
static

Initialise a Lua State.

Parameters
[out]lLua State
Return values
trueSuccessful

Definition at line 437 of file mutt_lua.c.

438{
439 if (!l)
440 return false;
441 if (*l)
442 return true;
443
444 mutt_debug(LL_DEBUG2, " * lua_init()\n");
445 *l = luaL_newstate();
446
447 if (!*l)
448 {
449 mutt_error(_("Error: Couldn't load the lua interpreter"));
450 return false;
451 }
452
453 lua_atpanic(*l, handle_panic);
454
455 /* load various Lua libraries */
456 luaL_openlibs(*l);
457 luaopen_mutt(*l);
458
459 return true;
460}
#define _(a)
Definition: message.h:28
static void luaopen_mutt(lua_State *l)
Expose a 'Mutt' object to the Lua interpreter.
Definition: mutt_lua.c:420
static int handle_panic(lua_State *l)
Handle a panic in the Lua interpreter.
Definition: mutt_lua.c:70
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_lua_init()

void mutt_lua_init ( void  )

Setup feature commands.

Definition at line 465 of file mutt_lua.c.

466{
468}
void commands_register(const struct Command *cmds, const size_t num_cmds)
Add commands to Commands array.
Definition: command.c:53
#define mutt_array_size(x)
Definition: memory.h:38
static const struct Command LuaCommands[]
List of NeoMutt commands to register.
Definition: mutt_lua.c:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ LuaState

lua_State* LuaState = NULL
static

Global Lua State.

Definition at line 53 of file mutt_lua.c.

◆ LuaCommands

const struct Command LuaCommands[]
static
Initial value:
= {
{ "lua", mutt_lua_parse, 0 },
{ "lua-source", mutt_lua_source_file, 0 },
}
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() -.
Definition: mutt_lua.c:495
enum CommandResult mutt_lua_parse(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'lua' command - Implements Command::parse() -.
Definition: mutt_lua.c:473

List of NeoMutt commands to register.

Definition at line 58 of file mutt_lua.c.

◆ LuaMuttCommands

const luaL_Reg LuaMuttCommands[]
static
Initial value:
= {
{ "set", lua_mutt_set },
{ "get", lua_mutt_get },
{ "call", lua_mutt_call },
{ "enter", lua_mutt_enter },
{ "print", lua_mutt_message },
{ "message", lua_mutt_message },
{ "error", lua_mutt_error },
{ NULL, NULL },
}
static int lua_mutt_enter(lua_State *l)
Execute NeoMutt config from Lua.
Definition: mutt_lua.c:305
static int lua_mutt_message(lua_State *l)
Display a message in Neomutt.
Definition: mutt_lua.c:336
static int lua_mutt_call(lua_State *l)
Call a NeoMutt command by name.
Definition: mutt_lua.c:97
static int lua_mutt_get(lua_State *l)
Get a NeoMutt variable.
Definition: mutt_lua.c:243
static int lua_mutt_error(lua_State *l)
Display an error in Neomutt.
Definition: mutt_lua.c:350
static int lua_mutt_set(lua_State *l)
Set a NeoMutt variable.
Definition: mutt_lua.c:155

List of Lua commands to register.

In NeoMutt, run:

‘:lua mutt.message('hello’)`

and it will call lua_mutt_message()

Definition at line 381 of file mutt_lua.c.