From 047ed8ad6cc16bcdd242e92f4e427f6bfcbb0c21 Mon Sep 17 00:00:00 2001 From: William Morgan Date: Wed, 16 Jan 2008 16:50:51 -0800 Subject: [PATCH] make '#' in thread-index-mode join all tagged threads into one thread No way to reverse this, yet. --- lib/sup/modes/thread-index-mode.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index 0d90be4..dec3c1d 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -33,6 +33,7 @@ EOS k.add :toggle_tagged_all, "Tag/untag all threads", 'T' k.add :tag_matching, "Tag matching threads", 'g' k.add :apply_to_tagged, "Apply next command to all tagged threads", ';' + k.add :join_threads, "Force tagged threads to be joined into the same thread", '#' end def initialize hidden_labels=[], load_thread_opts={} @@ -278,6 +279,18 @@ EOS regen_text end + def join_threads + ## this command has no non-tagged form. as a convenience, allow this + ## command to be applied to tagged threads without hitting ';'. + @tags.apply_to_tagged :join_threads + end + + def multi_join_threads threads + @ts.join_threads threads or return + @tags.drop_all_tags # otherwise we have tag pointers to invalid threads! + update + end + def jump_to_next_new n = @mutex.synchronize do ((curpos + 1) ... lines).find { |i| @threads[i].has_label? :unread } || -- 2.45.2