Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Commit

Permalink
Added global_unread() function.
Browse files Browse the repository at this point in the history
  This shows all unread messages, in all folders.  Awesome.
  • Loading branch information
skx committed Jun 3, 2013
1 parent befc6e5 commit 8d6cabe
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions lumail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8d6cabe

Please sign in to comment.