Lumail - The console email client


Lua primitives: count_messages()

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

When in index mode, set with global_mode, the user interface consists of a list of messages.

This function will count the number of messages which are visible.

For example this can be used to mark all messages read:

--
-- Mark all messages in the currently selected folder(s) as read.
--
function mark_all_read()
   count = count_messages()
   i = 0

   while( i < count ) do
      jump_index_to( i )
      mark_read()
      i = i + 1
   end
end

Availability

This function has been available since version 0.07.

See Also

See also count_maildirs, current_message.