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

From: Eric Sherman <[email-masked]>
Date: Thu, 28 Jan 2010 09:07:28 -0500

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
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Eric Sherman <[email-masked]>
Date: Thu, 28 Jan 2010 08:46:25 -0500

That doesn't quite work, as sup won't quit.  Another patch on its way.
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Eric Sherman <[email-masked]>
Date: Wed, 27 Jan 2010 21:48:43 -0500

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

 end
 
 end

---

From: Tero Tilus <[email-masked]>
Date: Wed, 27 Jan 2010 22:47:53 +0000

New submission from Tero Tilus <[email-masked]>:

[ this is a copy from <http://masanjin.net/sup-bugs/issue4> ]

As a related point, can I make it so that the log-mode and poll-mode buffers
aren't killable with 'x'? I get in the habit of pressing 'x', and occasionally
forget that when I'm viewing one of those buffers, I need to press 'I' instead.

----------
messages: 129
nosy: terotil
priority: feature request
ruby_version: any
status: unread
sup_version: 0.10
title: Log-mode and poll-mode buffers should not be killable

_________________________________________
Sup issue tracker <[email-masked]>
<http://masanjin.net/sup-bugs/issue54>
_________________________________________
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel