Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: israel.herraiz@gmail.com (Israel Herraiz)
Subject: [sup-talk] [PATCH] Keybinding to show a list of unread messages
Date: Sun, 19 Oct 2008 12:53:52 +0200	[thread overview]
Message-ID: <1224414435-sup-9918@elly> (raw)

Hi all,

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'.

Cheers,
Israel

---
 bin/sup |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/bin/sup b/bin/sup
index e27b3f7..74a4997 100644
--- 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
-- 
1.5.6.5



             reply	other threads:[~2008-10-19 10:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-19 10:53 Israel Herraiz [this message]
2008-10-20  2:41 ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1224414435-sup-9918@elly \
    --to=israel.herraiz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox