From: Matias Aguirre <matias@insophia.com>
To: "sup-devel" <sup-devel@rubyforge.org>
Subject: [sup-devel] Label colors support
Date: Tue, 03 Aug 2010 19:14:13 -0300 [thread overview]
Message-ID: <1280873473-sup-5265@mintaka> (raw)
[-- Attachment #1: Type: text/plain, Size: 412 bytes --]
Hi,
Been an user for some time now, congrats for the good work. But there's
something I've missed from mutt and is the ability to customize inbox
emails colors, I've used to colorize by source address or domain.
Attached is a patch (first ruby code in a lot of time) with needed
changes to allow colors by label and produces a good and quick feedback.
Cheers,
Matías
--
Matías Aguirre <matias@insophia.com>
[-- Attachment #2: color_labels.diff --]
[-- Type: application/octet-stream, Size: 1064 bytes --]
diff --git a/lib/sup/colormap.rb b/lib/sup/colormap.rb
index 7de48db..087995a 100644
--- a/lib/sup/colormap.rb
+++ b/lib/sup/colormap.rb
@@ -175,6 +175,10 @@ class Colormap
color
end
+ def sym_is_defined sym
+ return sym if @entries.member? sym
+ end
+
## Try to use the user defined colors, in case of an error fall back
## to the default ones.
def populate_colormap
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
index 0c7a3f2..c90a42c 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -893,7 +893,7 @@ protected
[:to_me_color, t.labels.member?(:attachment) ? "@" : " "],
[:to_me_color, dp ? ">" : (p ? '+' : " ")],
] +
- (t.labels - @hidden_labels).map { |label| [:label_color, "#{label} "] } +
+ (t.labels - @hidden_labels).map { |label| [Colormap.sym_is_defined("#{label}_color".to_sym) || :label_color, "#{label} "] } +
[
[subj_color, t.subj + (t.subj.empty? ? "" : " ")],
[:snippet_color, t.snippet],
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
next reply other threads:[~2010-08-03 22:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-03 22:14 Matias Aguirre [this message]
2010-08-04 16:41 ` Matias Aguirre
2010-08-04 16:50 ` Matias Aguirre
2010-08-19 8:13 ` Sascha Silbe
2010-08-19 21:04 ` Matias Aguirre
2011-01-26 20:20 ` Michael Stapelberg
2011-01-26 21:21 ` Matias Aguirre
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=1280873473-sup-5265@mintaka \
--to=matias@insophia.com \
--cc=sup-devel@rubyforge.org \
/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