Lumail - The console email client


Lua primitives: index_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 index you will be presented with a list of messages.

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

There are four options for limiting:

all

Show all messages.

new

Show all messages which are unread.

header:NAME:VAL

Show all messages which have a value matching the regular expression "VAL" in the header with name NAME.

"str"

Format the message as per index_format and show all messages which match the pattern "str".

For example:

--
-- When in index-mode show all messages.
--
function all_msg()
   index_limit( "all" );
   clear();
end

--
-- When in index-mode show all unread messages only.
--
function new_msg()
   index_limit( "new" );
   clear();
end


--
-- Toggle display of folders
--
keymap['index']['a'] = 'all_msg()'
keymap['index']['n'] = 'new_msg()'

As an example of the header-limiting you might wish to see all messages received in June:

-- Jun is used to cover the abbreviated form of the date.
index_limit( "HEADER:Date:Jun" );

You can limit on more than one header by using the |:

-- Limit to mails to/from me:
index_limit( "HEADER:To|From:steve@steve.org.uk" );

Availability

This function has been available since version 0.07.

See Also

See also get_variables, maildir_limit.