lib/sup/modes/thread_view_mode.rb in sup-0.17.0 vs lib/sup/modes/thread_view_mode.rb in sup-0.18.0
- old
+ new
@@ -76,31 +76,35 @@
k.add :unsubscribe_from_list, "Subscribe to/unsubscribe from mailing list", ")"
k.add :pipe_message, "Pipe message or attachment to a shell command", '|'
k.add :archive_and_next, "Archive this thread, kill buffer, and view next", 'a'
k.add :delete_and_next, "Delete this thread, kill buffer, and view next", 'd'
+ k.add :kill_and_next, "Kill this thread, kill buffer, and view next", '&'
k.add :toggle_wrap, "Toggle wrapping of text", 'w'
k.add_multi "(a)rchive/(d)elete/mark as (s)pam/mark as u(N)read:", '.' do |kk|
kk.add :archive_and_kill, "Archive this thread and kill buffer", 'a'
kk.add :delete_and_kill, "Delete this thread and kill buffer", 'd'
+ kk.add :kill_and_kill, "Kill this thread and kill buffer", '&'
kk.add :spam_and_kill, "Mark this thread as spam and kill buffer", 's'
kk.add :unread_and_kill, "Mark this thread as unread and kill buffer", 'N'
kk.add :do_nothing_and_kill, "Just kill this buffer", '.'
end
k.add_multi "(a)rchive/(d)elete/mark as (s)pam/mark as u(N)read/do (n)othing:", ',' do |kk|
kk.add :archive_and_next, "Archive this thread, kill buffer, and view next", 'a'
kk.add :delete_and_next, "Delete this thread, kill buffer, and view next", 'd'
+ kk.add :kill_and_next, "Kill this thread, kill buffer, and view next", '&'
kk.add :spam_and_next, "Mark this thread as spam, kill buffer, and view next", 's'
kk.add :unread_and_next, "Mark this thread as unread, kill buffer, and view next", 'N'
kk.add :do_nothing_and_next, "Kill buffer, and view next", 'n', ','
end
k.add_multi "(a)rchive/(d)elete/mark as (s)pam/mark as u(N)read/do (n)othing:", ']' do |kk|
kk.add :archive_and_prev, "Archive this thread, kill buffer, and view previous", 'a'
kk.add :delete_and_prev, "Delete this thread, kill buffer, and view previous", 'd'
+ kk.add :kill_and_prev, "Kill this thread, kill buffer, and view previous", '&'
kk.add :spam_and_prev, "Mark this thread as spam, kill buffer, and view previous", 's'
kk.add :unread_and_prev, "Mark this thread as unread, kill buffer, and view previous", 'N'
kk.add :do_nothing_and_prev, "Kill buffer, and view previous", 'n', ']'
end
end
@@ -579,22 +583,25 @@
end
def archive_and_kill; archive_and_then :kill end
def spam_and_kill; spam_and_then :kill end
def delete_and_kill; delete_and_then :kill end
+ def kill_and_kill; kill_and_then :kill end
def unread_and_kill; unread_and_then :kill end
def do_nothing_and_kill; do_nothing_and_then :kill end
def archive_and_next; archive_and_then :next end
def spam_and_next; spam_and_then :next end
def delete_and_next; delete_and_then :next end
+ def kill_and_next; kill_and_then :next end
def unread_and_next; unread_and_then :next end
def do_nothing_and_next; do_nothing_and_then :next end
def archive_and_prev; archive_and_then :prev end
def spam_and_prev; spam_and_then :prev end
def delete_and_prev; delete_and_then :prev end
+ def kill_and_prev; kill_and_then :prev end
def unread_and_prev; unread_and_then :prev end
def do_nothing_and_prev; do_nothing_and_then :prev end
def archive_and_then op
dispatch op do
@@ -629,9 +636,22 @@
Index.save_thread @thread
UndoManager.register "deleting 1 thread" do
@thread.remove_label :deleted
Index.save_thread @thread
UpdateManager.relay self, :undeleted, @thread.first
+ end
+ end
+ end
+
+ def kill_and_then op
+ dispatch op do
+ @thread.apply_label :killed
+ UpdateManager.relay self, :killed, @thread.first
+ Index.save_thread @thread
+ UndoManager.register "killed 1 thread" do
+ @thread.remove_label :killed
+ Index.save_thread @thread
+ UpdateManager.relay self, :unkilled, @thread.first
end
end
end
def unread_and_then op