Lua primitives: global_mode()
The lumail client is a modal mail-client which means you're always in one of four modes:
Viewing the list of Maildir folders.
Viewing the list of messages contained within your selected folder(s).
Viewing a single message.
The global_mode function will return the current mode, or allow you to change to a new one.
-- view the mode msg( "The current mode is " .. global_mode() ); -- change the mode global_mode( "maildir" ); -- -- Open a folder exclusively. -- -- This behaves like the traditional "open folder" -- function in our favourite mail client. -- function open_folder() clear_selected_folders(); add_selected_folder() global_mode( "index" ); clear(); end -- -- Call the function we've just defined if RETURN -- is pressed in maildir-mode -- keymap['maildir']['\n'] = 'open_folder()'
This function has been available since version 0.07.