Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] Label colors support
@ 2010-08-03 22:14 Matias Aguirre
  2010-08-04 16:41 ` Matias Aguirre
  2010-08-19  8:13 ` Sascha Silbe
  0 siblings, 2 replies; 7+ messages in thread
From: Matias Aguirre @ 2010-08-03 22:14 UTC (permalink / raw)
  To: sup-devel

[-- 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-devel] Label colors support
  2010-08-03 22:14 [sup-devel] Label colors support Matias Aguirre
@ 2010-08-04 16:41 ` Matias Aguirre
  2010-08-04 16:50   ` Matias Aguirre
  2010-08-19  8:13 ` Sascha Silbe
  1 sibling, 1 reply; 7+ messages in thread
From: Matias Aguirre @ 2010-08-04 16:41 UTC (permalink / raw)
  To: sup-devel

Forgot to mention that colors are defined in colors.yaml using label
names and common attributes:

    :somelabel:
        :bg: ...
        :fg: ...
        :attrs:
            ...

Also, I've forked sup on my github account, changeset can be checked here
http://github.com/omab/sup/commit/a6f9bfb5d1f23aa6376ad725e64a3e2c3066663d

Thanks,
Matías

Excerpts from Matias Aguirre's message of Tue Aug 03 19:14:13 -0300 2010:
> 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>
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-devel] Label colors support
  2010-08-04 16:41 ` Matias Aguirre
@ 2010-08-04 16:50   ` Matias Aguirre
  0 siblings, 0 replies; 7+ messages in thread
From: Matias Aguirre @ 2010-08-04 16:50 UTC (permalink / raw)
  To: sup-devel

Sorry, wrong github link, this is the correct changeset:
http://github.com/omab/sup/commit/865bc2b77038f612ccf0c5174021f001811116a4

Excerpts from Matias Aguirre's message of Wed Aug 04 13:41:26 -0300 2010:
> Forgot to mention that colors are defined in colors.yaml using label
> names and common attributes:
> 
>     :somelabel:
>         :bg: ...
>         :fg: ...
>         :attrs:
>             ...
> 
> Also, I've forked sup on my github account, changeset can be checked here
> http://github.com/omab/sup/commit/a6f9bfb5d1f23aa6376ad725e64a3e2c3066663d
> 
> Thanks,
> Matías
> 
> Excerpts from Matias Aguirre's message of Tue Aug 03 19:14:13 -0300 2010:
> > 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>
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-devel] Label colors support
  2010-08-03 22:14 [sup-devel] Label colors support Matias Aguirre
  2010-08-04 16:41 ` Matias Aguirre
@ 2010-08-19  8:13 ` Sascha Silbe
  2010-08-19 21:04   ` Matias Aguirre
  1 sibling, 1 reply; 7+ messages in thread
From: Sascha Silbe @ 2010-08-19  8:13 UTC (permalink / raw)
  To: sup-devel


[-- Attachment #1.1: Type: text/plain, Size: 436 bytes --]

Excerpts from Matias Aguirre's message of Wed Aug 04 00:14:13 +0200 2010:

> 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.
Nice idea! Would you mind prefixing (or suffixing) the color name with
"label" to prevent name clashes and make it clearer what the colors are
used for?

Sascha

--
http://sascha.silbe.org/
http://www.infra-silbe.de/

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-devel] Label colors support
  2010-08-19  8:13 ` Sascha Silbe
@ 2010-08-19 21:04   ` Matias Aguirre
  2011-01-26 20:20     ` Michael Stapelberg
  0 siblings, 1 reply; 7+ messages in thread
From: Matias Aguirre @ 2010-08-19 21:04 UTC (permalink / raw)
  To: sup-devel

Excerpts from Sascha Silbe's message of Thu Aug 19 05:13:34 -0300 2010:
> Excerpts from Matias Aguirre's message of Wed Aug 04 00:14:13 +0200 2010:
> 
> > 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.
> Nice idea! Would you mind prefixing (or suffixing) the color name with
> "label" to prevent name clashes and make it clearer what the colors are
> used for?

Indeed that will be clearer, here's the changeset:
http://github.com/omab/sup/commit/1a96a0ae856076d645a11e0b7d94858851343e27

Thanks,
Matías

> Sascha
--
Matías Aguirre <matiasaguirre@gmail.com>
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-devel] Label colors support
  2010-08-19 21:04   ` Matias Aguirre
@ 2011-01-26 20:20     ` Michael Stapelberg
  2011-01-26 21:21       ` Matias Aguirre
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Stapelberg @ 2011-01-26 20:20 UTC (permalink / raw)
  To: sup-devel

Hi Matias,

Excerpts from Matias Aguirre's message of 2010-08-19 23:04:36 +0200:
> Indeed that will be clearer, here's the changeset:
> http://github.com/omab/sup/commit/1a96a0ae856076d645a11e0b7d94858851343e27
I just created a branch 'label-colors' and merged it into 'next' of
sup/mainline (based on your merged request on gitorious).

Thanks for contributing!

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-devel] Label colors support
  2011-01-26 20:20     ` Michael Stapelberg
@ 2011-01-26 21:21       ` Matias Aguirre
  0 siblings, 0 replies; 7+ messages in thread
From: Matias Aguirre @ 2011-01-26 21:21 UTC (permalink / raw)
  To: sup-devel

Excerpts from Michael Stapelberg's message of Wed Jan 26 18:20:55 -0200 2011:
> Hi Matias,
> 
> Excerpts from Matias Aguirre's message of 2010-08-19 23:04:36 +0200:
> > Indeed that will be clearer, here's the changeset:
> > http://github.com/omab/sup/commit/1a96a0ae856076d645a11e0b7d94858851343e27
> I just created a branch 'label-colors' and merged it into 'next' of
> sup/mainline (based on your merged request on gitorious).

That's great, thanks!

> Thanks for contributing!
> 
> Best regards,
> Michael
-- 
Matías Aguirre <matiasaguirre@gmail.com>
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-26 21:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-03 22:14 [sup-devel] Label colors support Matias Aguirre
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox