From: Eric Sherman <hyperbolist@gmail.com>
To: sup-devel <sup-devel@rubyforge.org>
Subject: [sup-devel] [PATCHv2] [issue54] log-mode and poll-mode buffers are not killable
Date: Thu, 28 Jan 2010 09:07:28 -0500 [thread overview]
Message-ID: <1264687215-sup-8249@changeling.local> (raw)
In-Reply-To: <1264632472.97.0.545373102631.issue54@masanjin.net>
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
prev parent reply other threads:[~2010-01-28 14:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 22:47 [sup-devel] [issue54] Log-mode and poll-mode buffers should not be killable Tero Tilus
2010-01-28 2:48 ` [sup-devel] [PATCH] [issue54] log-mode and poll-mode buffers are not killable Eric Sherman
2010-01-28 13:46 ` Eric Sherman
2010-01-28 14:07 ` Eric Sherman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1264687215-sup-8249@changeling.local \
--to=hyperbolist@gmail.com \
--cc=sup-devel@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox