Lumail - The console email client


Lua primitives: maildir_limit()

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

When the global_mode is set to maildir you will be presented with a list of Maildir folders.

The list will default to showing all available folders, but you may use maildir_limit() to change this.

There are three options for limiting:

all

Show all maildirs.

new

Show all maildirs which contain unread messages.

"str"

Show all maildirs match the pattern "str".

For example:

--
-- When in maildir-mode show all folders.
--
function all_folders()
   maildir_limit( "all" );
   clear();
end

--
-- When in maildir-mode show all folders which contain unread messages.
--
function new_folders()
   maildir_limit( "new" );
   clear();
end

--
-- When in maildir-mode show all folders which have a path matching the given pattern.
--
function livejournal_folders()
   maildir_limit( "livejournal.2" );
   clear();
end

--
-- Toggle display of folders
--
keymap['maildir']['a'] = 'all_folders()'
keymap['maildir']['n'] = 'new_folders()'
keymap['maildir']['l'] = 'livejournal_folders()'

If this primitive isn't sufficient for your needs then you might wish to look at the filter_maildirs hook.

Availability

This function has been available since version 0.07.

See Also

See also filter_maildirs, get_variables, ignored_folders, index_limit.