Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added global_unread() function.

  This shows all unread messages, in all folders.  Awesome.
  • Loading branch information...
commit 8d6cabea140d79310da695ec9f2f8b811ebdcec9 1 parent befc6e5
@skx authored
Showing with 43 additions and 0 deletions.
  1. +43 −0 lumail.lua
View
43 lumail.lua
@@ -713,3 +713,46 @@ function mark_spam_ip()
end
end
keymap['global']['F'] = 'mark_spam_ip()'
+
+
+
+--
+-- Open all folders that contain unread messages, and view them all.
+--
+function global_unread()
+
+ -- set the mode appropriately.
+ maildir_limit( "new" );
+ global_mode( "maildir" );
+
+ -- get all visible folders - i.e. those containing unread mails.
+ dirs = current_maildirs();
+
+ -- ensure we have no selected folders.
+ clear_selected_folders();
+
+ offset = 0;
+
+ -- Now for each one we'll add it to the selected set.
+ while( offset <= (count_maildirs() - 1) ) do
+
+ -- jump to folder.
+ jump_maildir_to( offset )
+
+ -- Added the folder to the selected set.
+ add_selected_folder()
+
+ -- move to the next.
+ offset = offset + 1;
+ end
+
+ --
+ -- Now we've added all maildirs with new mail to the list
+ -- of selected maildirs.
+ --
+ -- Jump to the global index-mode, and view only new mails.
+ --
+ --
+ global_mode( "index" );
+ index_limit( "new" );
+end
Please sign in to comment.
Something went wrong with that request. Please try again.