This hook is run when the user presses on '$' to save the state and
index.
I'm using this to update a file used by my dzen status bar to display the
number of unread emails in my inbox.
diff --git a/lib/sup/modes/thread-index-mode.rb
b/lib/sup/modes/thread-index-mode.rb
index 56dcdff..e3e70bb 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -20,6 +20,12 @@ Variables:
thread: The message thread being marked as spam.
EOS
+ HookManager.register "after-save", <<EOS
+Executes immediately after saving the index.
+Variables:
+num_inbox_total_unread: the total number of unread messages in the inbox
+EOS
+
register_keymap do |k|
k.add :load_threads, "Load #{LOAD_MORE_THREAD_NUM} more threads", 'M'
k.add_multi "Load all threads (! to confirm) :", '!' do |kk|
@@ -409,6 +415,7 @@ EOS
end
end
end
+ HookManager.run "after-save", :num_inbox_total_unread => lambda {
Index.num_results_for :labels => [:inbox, :unread] }
end
def cleanup
--
Henri
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk