[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-devel] [PATCH] show (recipients) instead of lone "me"



I've changed thread-index-mode to show recipients in () parens instead
of "me" in the From field for threads from me with no replies.

I've developed the habit of archiving a new thread as soon as I send it,
so until I receive a reply it's effectively non-existent.  When checking
on emails I may want to follow up on with a search like "is:sent AND
after:(14 days ago) AND before:(3 days ago)" I would get a pile of lone
"me"'s in the From field.  I would then open each of them to decide
whether or not to follow up based on who it was sent to.

So this helps me cut down on the j<CR>x loops in that scenario.

I'm not sure if this is something that is universally desirable, but
here's the patch anyway.
---
 lib/sup/modes/thread-index-mode.rb |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
index a6bb2b9..0774aa8 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -793,6 +793,16 @@ protected
       result << [name, new[a]]
     end
 
+    if result.size == 1 && (author_and_newness = result.assoc("me"))
+      unless (recipients = t.participants - t.authors).empty?
+        result = recipients.collect do |r|
+          break if limit && result.size >= limit
+          name = (recipients.size == 1) ? r.mediumname : r.shortname
+          ["(#{name})", author_and_newness[1]]
+        end
+      end
+    end
+
     result
   end
 
-- 
1.6.6

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel