sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit d0bd834de55b11d39f3573efb7ef95e4ce4c1d42
parent 64eb5abdc3fc0f9b1254a5c4f45d35d786da89ac
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Tue,  6 Oct 2009 13:28:47 -0400

Merge branch 'refine-inbox-mode' into next

Diffstat:
M lib/sup/modes/inbox-mode.rb | 8 ++++++++
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/inbox-mode.rb b/lib/sup/modes/inbox-mode.rb
@@ -7,6 +7,7 @@ class InboxMode < ThreadIndexMode
     ## overwrite toggle_archived with archive
     k.add :archive, "Archive thread (remove from inbox)", 'a'
     k.add :read_and_archive, "Archive thread (remove from inbox) and mark read", 'A'
+    k.add :refine_search, "Refine search", '|'
   end
 
   def initialize
@@ -17,6 +18,13 @@ class InboxMode < ThreadIndexMode
 
   def is_relevant? m; (m.labels & [:spam, :deleted, :killed, :inbox]) == Set.new([:inbox]) end
 
+  def refine_search
+    text = BufferManager.ask :search, "refine inbox with query: "
+    return unless text && text !~ /^\s*$/
+    text = "label:inbox -label:spam -label:deleted " + text
+    SearchResultsMode.spawn_from_query text
+  end
+
   ## label-list-mode wants to be able to raise us if the user selects
   ## the "inbox" label, so we need to keep our singletonness around
   def self.instance; @@instance; end