Lumail - The console email client

Lua primitives: get_variables()

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

The lumail client has several variables which are set such as:

Internally all these variables are stored as a hash, and the get_variables() function allows you to recieve a read-only copy of this hash.

For example:

-- Dump the current variables to a temporary file.
function dump_vars()
   -- where we log
   ff = "/tmp/vars.log", "w");

   vars = get_variables();

   -- Note the use of "pairs" here, rather than "ipairs".
   for i,v in pairs( vars ) do
      ff:write( "Setting " .. i .. " has value " .. v .. "\n" );

The names and values of the variables should be obvious when compared to the list of Lua primitives. As an example the function above dumps this for me;

Setting attachment_colour has value white
Setting sort has value NULL
Setting sendmail_path has value /usr/lib/sendmail -t
Setting header_colour has value white
Setting unread_message_colour has value red
Setting editor has value /usr/bin/vim
Setting sent_mail has value /home/skx/Maildir/sent-mail
Setting message_filter has value
Setting index_format has value [$FLAGS] $DAY/$MONTH/$YEAR $FROM - $SUBJECT
Setting index_limit has value all
Setting global_mode has value index
Setting maildir_limit has value all
Setting tmp has value /tmp
Setting from has value Steve Kemp 
Setting maildir_format has value $CHECK - $UNREAD/$TOTAL - $PATH
Setting unread_maildir_colour has value red
Setting body_colour has value white
Setting maildir_prefix has value /home/skx/Maildir


This function has been available since version 0.08.

See Also