NeoMutt  2024-02-01-25-ga71e95
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
  • Bernard Pratz
  • Richard Russon
  • Victor Fernandes
  • Ian Zimmerman
  • Pietro Cerutti
  • Rayford Shireman

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 35 of file mutt_lua.c.

◆ LUA_COMPAT_5_1

#define LUA_COMPAT_5_1

Definition at line 38 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 74 of file mutt_lua.c.

75{
76 mutt_debug(LL_DEBUG1, "lua runtime panic: %s\n", lua_tostring(l, -1));
77 mutt_error("Lua runtime panic: %s", lua_tostring(l, -1));
78 lua_pop(l, 1);
79 return -1;
80}
#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 87 of file mutt_lua.c.

88{
89 mutt_debug(LL_DEBUG1, "lua runtime error: %s\n", lua_tostring(l, -1));
90 mutt_error("Lua runtime error: %s", lua_tostring(l, -1));
91 lua_pop(l, 1);
92 return -1;
93}
+ 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 101 of file mutt_lua.c.

102{
103 mutt_debug(LL_DEBUG2, " * lua_mutt_call()\n");
104 struct Buffer *err = buf_pool_get();
105 struct Buffer *token = buf_pool_get();
106 char buf[1024] = { 0 };
107 const struct Command *cmd = NULL;
108 int rc = 0;
109
110 if (lua_gettop(l) == 0)
111 {
112 luaL_error(l, "Error command argument required.");
113 return -1;
114 }
115
116 cmd = command_get(lua_tostring(l, 1));
117 if (!cmd)
118 {
119 luaL_error(l, "Error command %s not found.", lua_tostring(l, 1));
120 return -1;
121 }
122
123 for (int i = 2; i <= lua_gettop(l); i++)
124 {
125 const char *s = lua_tostring(l, i);
126 mutt_strn_cat(buf, sizeof(buf), s, mutt_str_len(s));
127 mutt_strn_cat(buf, sizeof(buf), " ", 1);
128 }
129
130 struct Buffer expn = buf_make(0);
131 expn.data = buf;
132 expn.dptr = buf;
133 expn.dsize = mutt_str_len(buf);
134
135 if (cmd->parse(token, &expn, cmd->data, err))
136 {
137 luaL_error(l, "NeoMutt error: %s", buf_string(err));
138 rc = -1;
139 }
140 else
141 {
142 if (!lua_pushstring(l, buf_string(err)))
143 handle_error(l);
144 else
145 rc++;
146 }
147
148 buf_pool_release(&token);
149 buf_pool_release(&err);
150 return rc;
151}
struct Buffer buf_make(size_t size)
Make a new buffer on the stack.
Definition: buffer.c:75
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:97
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:297
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:545
static int handle_error(lua_State *l)
Handle an error in the Lua interpreter.
Definition: mutt_lua.c:87
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:36
char * dptr
Current read/write position.
Definition: buffer.h:38
size_t dsize
Length of data.
Definition: buffer.h:39
char * data
Pointer to data.
Definition: buffer.h:37
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 159 of file mutt_lua.c.

160{
161 const char *param = lua_tostring(l, -2);
162 mutt_debug(LL_DEBUG2, " * lua_mutt_set(%s)\n", param);
163
164 struct Buffer err = buf_make(256);
165 struct HashElem *he = cs_subset_lookup(NeoMutt->sub, param);
166 if (!he)
167 {
168 // In case it is a my_var, we have to create it
169 if (mutt_str_startswith(param, "my_"))
170 {
171 struct ConfigDef my_cdef = { 0 };
172 my_cdef.name = param;
173 my_cdef.type = DT_MYVAR;
174 he = cs_create_variable(NeoMutt->sub->cs, &my_cdef, &err);
175 if (!he)
176 return -1;
177 }
178 else
179 {
180 luaL_error(l, "NeoMutt parameter not found %s", param);
181 return -1;
182 }
183 }
184
185 struct ConfigDef *cdef = he->data;
186
187 int rc = 0;
188
189 switch (DTYPE(cdef->type))
190 {
191 case DT_ADDRESS:
192 case DT_ENUM:
193 case DT_MBTABLE:
194 case DT_MYVAR:
195 case DT_PATH:
196 case DT_REGEX:
197 case DT_SLIST:
198 case DT_SORT:
199 case DT_STRING:
200 {
201 const char *value = lua_tostring(l, -1);
202 size_t val_size = lua_rawlen(l, -1);
203 struct Buffer value_buf = buf_make(val_size);
204 buf_strcpy_n(&value_buf, value, val_size);
205 if (DTYPE(he->type) == DT_PATH)
206 buf_expand_path(&value_buf);
207
208 int rv = cs_subset_he_string_set(NeoMutt->sub, he, value_buf.data, &err);
209 buf_dealloc(&value_buf);
210 if (CSR_RESULT(rv) != CSR_SUCCESS)
211 rc = -1;
212 break;
213 }
214 case DT_NUMBER:
215 case DT_QUAD:
216 {
217 const intptr_t value = lua_tointeger(l, -1);
218 int rv = cs_subset_he_native_set(NeoMutt->sub, he, value, &err);
219 if (CSR_RESULT(rv) != CSR_SUCCESS)
220 rc = -1;
221 break;
222 }
223 case DT_BOOL:
224 {
225 const intptr_t value = lua_toboolean(l, -1);
226 int rv = cs_subset_he_native_set(NeoMutt->sub, he, value, &err);
227 if (CSR_RESULT(rv) != CSR_SUCCESS)
228 rc = -1;
229 break;
230 }
231 default:
232 luaL_error(l, "Unsupported NeoMutt parameter type %d for %s", DTYPE(cdef->type), param);
233 rc = -1;
234 break;
235 }
236
237 buf_dealloc(&err);
238 return rc;
239}
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:394
size_t buf_strcpy_n(struct Buffer *buf, const char *s, size_t len)
Copy a string into a Buffer.
Definition: buffer.c:433
struct HashElem * cs_create_variable(const struct ConfigSet *cs, struct ConfigDef *cdef, struct Buffer *err)
Create and register one config item.
Definition: set.c:318
#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:230
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Definition: muttlib.c:331
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:43
int type
Type of data stored in Hash Table, e.g. DT_STRING.
Definition: hash.h:44
void * data
User-supplied data.
Definition: hash.h:46
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:275
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:364
struct HashElem * cs_subset_lookup(const struct ConfigSubset *sub, const char *name)
Find an inherited config item.
Definition: subset.c:187
#define DTYPE(t)
Definition: types.h:49
@ DT_NUMBER
a number
Definition: types.h:38
@ DT_SLIST
a list of strings
Definition: types.h:42
@ DT_BOOL
boolean option
Definition: types.h:32
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition: types.h:40
@ DT_STRING
a string
Definition: types.h:44
@ DT_SORT
sorting methods
Definition: types.h:43
@ DT_MYVAR
a user-defined variable (my_foo)
Definition: types.h:37
@ DT_MBTABLE
multibyte char table
Definition: types.h:36
@ DT_ADDRESS
e-mail address
Definition: types.h:31
@ DT_ENUM
an enumeration
Definition: types.h:33
@ DT_REGEX
regular expressions
Definition: types.h:41
@ DT_PATH
a path to a file/directory
Definition: types.h:39
+ 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 247 of file mutt_lua.c.

248{
249 const char *param = lua_tostring(l, -1);
250 mutt_debug(LL_DEBUG2, " * lua_mutt_get(%s)\n", param);
251
252 struct HashElem *he = cs_subset_lookup(NeoMutt->sub, param);
253 if (!he)
254 {
255 mutt_debug(LL_DEBUG2, " * error\n");
256 luaL_error(l, "NeoMutt parameter not found %s", param);
257 return -1;
258 }
259
260 struct ConfigDef *cdef = he->data;
261
262 switch (DTYPE(cdef->type))
263 {
264 case DT_ADDRESS:
265 case DT_ENUM:
266 case DT_MBTABLE:
267 case DT_MYVAR:
268 case DT_REGEX:
269 case DT_SLIST:
270 case DT_SORT:
271 case DT_STRING:
272 {
273 struct Buffer value = buf_make(256);
274 int rc = cs_subset_he_string_get(NeoMutt->sub, he, &value);
275 if (CSR_RESULT(rc) != CSR_SUCCESS)
276 {
277 buf_dealloc(&value);
278 return -1;
279 }
280
281 struct Buffer escaped = buf_make(256);
282 escape_string(&escaped, value.data);
283 lua_pushstring(l, escaped.data);
284 buf_dealloc(&value);
285 buf_dealloc(&escaped);
286 return 1;
287 }
288 case DT_QUAD:
289 lua_pushinteger(l, (unsigned char) cdef->var);
290 return 1;
291 case DT_NUMBER:
292 lua_pushinteger(l, (signed short) cdef->var);
293 return 1;
294 case DT_BOOL:
295 lua_pushboolean(l, (bool) cdef->var);
296 return 1;
297 default:
298 luaL_error(l, "NeoMutt parameter type %d unknown for %s", cdef->type, param);
299 return -1;
300 }
301}
size_t escape_string(struct Buffer *buf, const char *src)
Write a string to a buffer, escaping special characters.
Definition: dump.c:48
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:332
+ 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 309 of file mutt_lua.c.

310{
311 mutt_debug(LL_DEBUG2, " * lua_mutt_enter()\n");
312 struct Buffer *err = buf_pool_get();
313 char *buf = mutt_str_dup(lua_tostring(l, -1));
314 int rc = 0;
315
316 if (parse_rc_line(buf, err))
317 {
318 luaL_error(l, "NeoMutt error: %s", buf_string(err));
319 rc = -1;
320 }
321 else
322 {
323 if (!lua_pushstring(l, buf_string(err)))
324 handle_error(l);
325 else
326 rc++;
327 }
328
329 FREE(&buf);
330 buf_pool_release(&err);
331
332 return rc;
333}
#define FREE(x)
Definition: memory.h:45
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:253
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 340 of file mutt_lua.c.

341{
342 mutt_debug(LL_DEBUG2, " * lua_mutt_message()\n");
343 const char *msg = lua_tostring(l, -1);
344 if (msg)
345 mutt_message("%s", msg);
346 return 0;
347}
#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 354 of file mutt_lua.c.

355{
356 mutt_debug(LL_DEBUG2, " * lua_mutt_error()\n");
357 const char *msg = lua_tostring(l, -1);
358 if (msg)
359 mutt_error("%s", msg);
360 return 0;
361}

◆ 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 368 of file mutt_lua.c.

369{
370 char buf[1024] = { 0 };
371 snprintf(buf, sizeof(buf), "mutt.command.%s = function (...); mutt.call('%s', ...); end",
372 cmd->name, cmd->name);
373 (void) luaL_dostring(l, buf);
374}
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 403 of file mutt_lua.c.

404{
405 mutt_debug(LL_DEBUG2, " * luaopen_mutt()\n");
406 luaL_newlib(l, LuaMuttCommands);
407 int lib_idx = lua_gettop(l);
408
409 // clang-format off
410 lua_pushstring(l, "VERSION"); lua_pushstring(l, mutt_make_version()); lua_settable(l, lib_idx);;
411 lua_pushstring(l, "QUAD_YES"); lua_pushinteger(l, MUTT_YES); lua_settable(l, lib_idx);;
412 lua_pushstring(l, "QUAD_NO"); lua_pushinteger(l, MUTT_NO); lua_settable(l, lib_idx);;
413 lua_pushstring(l, "QUAD_ASKYES"); lua_pushinteger(l, MUTT_ASKYES); lua_settable(l, lib_idx);;
414 lua_pushstring(l, "QUAD_ASKNO"); lua_pushinteger(l, MUTT_ASKNO); lua_settable(l, lib_idx);;
415 // clang-format on
416
417 return 1;
418}
static const luaL_Reg LuaMuttCommands[]
List of Lua commands to register.
Definition: mutt_lua.c:385
const char * mutt_make_version(void)
Generate the NeoMutt version string.
Definition: muttlib.c:1436
@ 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 424 of file mutt_lua.c.

425{
426 luaL_requiref(l, "mutt", luaopen_mutt_decl, 1);
427 (void) luaL_dostring(l, "mutt.command = {}");
428
429 struct Command *c = NULL;
430 for (size_t i = 0, size = commands_array(&c); i < size; i++)
431 {
432 lua_expose_command(l, &c[i]);
433 }
434}
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:368
static int luaopen_mutt_decl(lua_State *l)
Declare some NeoMutt types to the Lua interpreter.
Definition: mutt_lua.c:403
+ 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 441 of file mutt_lua.c.

442{
443 if (!l)
444 return false;
445 if (*l)
446 return true;
447
448 mutt_debug(LL_DEBUG2, " * lua_init()\n");
449 *l = luaL_newstate();
450
451 if (!*l)
452 {
453 mutt_error(_("Error: Couldn't load the lua interpreter"));
454 return false;
455 }
456
457 lua_atpanic(*l, handle_panic);
458
459 /* load various Lua libraries */
460 luaL_openlibs(*l);
461 luaopen_mutt(*l);
462
463 return true;
464}
#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:424
static int handle_panic(lua_State *l)
Handle a panic in the Lua interpreter.
Definition: mutt_lua.c:74
+ 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 469 of file mutt_lua.c.

470{
472}
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:62
+ 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 57 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:499
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:477

List of NeoMutt commands to register.

Definition at line 62 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:309
static int lua_mutt_message(lua_State *l)
Display a message in Neomutt.
Definition: mutt_lua.c:340
static int lua_mutt_call(lua_State *l)
Call a NeoMutt command by name.
Definition: mutt_lua.c:101
static int lua_mutt_get(lua_State *l)
Get a NeoMutt variable.
Definition: mutt_lua.c:247
static int lua_mutt_error(lua_State *l)
Display an error in Neomutt.
Definition: mutt_lua.c:354
static int lua_mutt_set(lua_State *l)
Set a NeoMutt variable.
Definition: mutt_lua.c:159

List of Lua commands to register.

In NeoMutt, run:

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

and it will call lua_mutt_message()

Definition at line 385 of file mutt_lua.c.