sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 920f40d6c5ba04af2e79cf8c5350bb91e00d712f
parent 624298c1da52ee295e7468583385eac659ef6070
Author: Eric Sherman <hyperbolist@gmail.com>
Date:   Sat, 23 Jan 2010 00:42:56 -0500

idle and unidle updates

Now handled outside of the main thread to accommodate shelling out to
the editor.

[PATCH] flush index on idle
and
[PATCHv5] [issue14] poll updates accumulate while idle
will still work with this patch.

Diffstat:
M bin/sup | 4 ++++
M lib/sup.rb | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/bin/sup b/bin/sup
@@ -244,6 +244,7 @@ begin
 
   unless $opts[:no_threads]
     PollManager.start
+    IdleManager.start
     Index.start_lock_update_thread
   end
 
@@ -268,6 +269,8 @@ begin
       next
     end
 
+    IdleManager.ping
+
     if c == 410
       ## this is ncurses's way of telling us it's detected a refresh.
       ## since we have our own sigwinch handler, we don't do anything.
@@ -376,6 +379,7 @@ rescue Exception => e
 ensure
   unless $opts[:no_threads]
     PollManager.stop if PollManager.instantiated?
+    IdleManager.stop if IdleManager.instantiated?
     Index.stop_lock_update_thread
   end
 
diff --git a/lib/sup.rb b/lib/sup.rb
@@ -133,6 +133,7 @@ module Redwood
     Redwood::UndoManager.init
     Redwood::SourceManager.init
     Redwood::SearchManager.init Redwood::SEARCH_FN
+    Redwood::IdleManager.init
   end
 
   def finish
@@ -346,6 +347,7 @@ require "sup/modes/console-mode"
 require "sup/sent"
 require "sup/search"
 require "sup/modes/search-list-mode"
+require "sup/idle"
 
 $:.each do |base|
   d = File.join base, "sup/share/modes/"