Lumail - The console email client

Lua primitives: stuff()

NOTE: Lumail-legacy has been superseded by Lumail 2.x, which has a wholly unified Lua API.

The stuff function will insert keystrokes into the input-buffer, which will allow preset-keys to be typed via a function-call.

For example if you wished to echo a message you'd ordinarily run:

:msg( "Test" );

(Where ":" activates the input mode, allowing Lua expressions to be evaluated, and msg() is a primitive lumail exports).

If you wished to automate this function you could run:

-- Cause a message to be displayed, indirectly
stuff( ":msg(\"OK\");\n" );

This would emulate the user typing the :msg(...);\n keys, and ultimately show the message.

This function can be useful to ensure that you run daily jobs on-startup. For example:

$ lumail --eval 'stuff( ":daily()\n" )'

Which would invoke the user-defined daily function.


This function has been available since version 0.16.

See Also

See also prompt.