sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 6a42f329a41671b2b827a2fbf1489db5755d201a
parent 042bae119286c470816a1b9fa35ff21531f9a4be
Author: Israel Herraiz <israel.herraiz@gmail.com>
Date:   Sun, 19 Oct 2008 12:53:52 +0200

keybinding to show a list of unread messages

this patch adds a global keybinding to make a search of all the unread
messages. I use this quite often, and maybe it can be useful for
others too.

The keybinding is 'U'.

Diffstat:
M bin/sup | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
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