sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 047ed8ad6cc16bcdd242e92f4e427f6bfcbb0c21
parent c5b6e20d3be0391c324440be7c32a5baaffa1fd6
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Wed, 16 Jan 2008 16:50:51 -0800

make '#' in thread-index-mode join all tagged threads into one thread

No way to reverse this, yet.

Diffstat:
M lib/sup/modes/thread-index-mode.rb | 13 +++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git 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 } ||