From: William Morgan Date: Thu, 17 Jan 2008 00:50:51 +0000 (-0800) Subject: make '#' in thread-index-mode join all tagged threads into one thread X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=047ed8ad6cc16bcdd242e92f4e427f6bfcbb0c21;p=sup make '#' in thread-index-mode join all tagged threads into one thread No way to reverse this, yet. --- 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 } ||