sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit a426c914c3734e67d161d459c23c916810755ccf
parent 81f446537366d39d41035d47ecf7a7cc2b9c3b75
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Sun, 19 Oct 2008 19:41:01 -0700

Merge branch 'master' into next

Diffstat:
M bin/sup | 3 +++
M lib/sup/label.rb | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/bin/sup b/bin/sup
@@ -65,6 +65,7 @@ global_keymap = Keymap.new do |k|
   k.add :list_contacts, "List contacts", 'C'
   k.add :redraw, "Redraw screen", :ctrl_l
   k.add :search, "Search all messages", '\\', 'F'
+  k.add :search_unread, "Show all unread messages", 'U'
   k.add :list_labels, "List labels", 'L'
   k.add :poll, "Poll for new messages", 'P'
   k.add :compose, "Compose new message", 'm', 'c'
@@ -220,6 +221,8 @@ begin
       query = BufferManager.ask :search, "search all messages: "
       next unless query && query !~ /^\s*$/
       SearchResultsMode.spawn_from_query query
+    when :search_unread
+      SearchResultsMode.spawn_from_query "is:unread"
     when :list_labels
       labels = LabelManager.listable_labels.map { |l| LabelManager.string_for l }
       user_label = bm.ask_with_completions :label, "Show threads with label (enter for listing): ", labels
diff --git a/lib/sup/label.rb b/lib/sup/label.rb
@@ -78,7 +78,7 @@ class LabelManager
 
   def save
     return unless @modified
-    File.open(@fn, "w") { |f| f.puts @labels.keys }
+    File.open(@fn, "w") { |f| f.puts @labels.keys.sort }
   end
 end