[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-devel] [PATCHv2] [issue54] log-mode and poll-mode buffers are not killable



Oops.  Now, with the ability to quit sup.

---
 lib/sup/buffer.rb          |    4 ++--
 lib/sup/modes/log-mode.rb  |    2 ++
 lib/sup/modes/poll-mode.rb |    2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index 990dd4a..5fb1047 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -414,8 +414,8 @@ EOS
 
   def kill_all_buffers_safely
     until @buffers.empty?
-      ## inbox mode always claims it's unkillable. we'll ignore it.
-      return false unless @buffers.last.mode.is_a?(InboxMode) || @buffers.last.mode.killable?
+      ## inbox, log and poll modes always claim they're unkillable. we'll ignore them.
+      return false unless @buffers.last.mode.is_a?(InboxMode) || @buffers.last.mode.is_a?(LogMode) ||  @buffers.last.mode.is_a?(PollMode) || @buffers.last.mode.killable?
       kill_buffer @buffers.last
     end
     true
diff --git a/lib/sup/modes/log-mode.rb b/lib/sup/modes/log-mode.rb
index de320ce..e583caf 100644
--- a/lib/sup/modes/log-mode.rb
+++ b/lib/sup/modes/log-mode.rb
@@ -52,6 +52,8 @@ class LogMode < TextMode
     self.text = ""
     super
   end
+
+  def killable?; false; end
 end
 
 end
diff --git a/lib/sup/modes/poll-mode.rb b/lib/sup/modes/poll-mode.rb
index cf61343..deb22d6 100644
--- a/lib/sup/modes/poll-mode.rb
+++ b/lib/sup/modes/poll-mode.rb
@@ -14,6 +14,8 @@ class PollMode < LogMode
     self << "Poll started at #{Time.now}\n"
     PollManager.do_poll { |s| self << (s + "\n") }
   end
+
+  def killable?; false; end
 end
 
 end
-- 
1.6.6
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel