From: Hamish <dmishd@gmail.com>
To: Philippe LeCavalier <support@plecavalier.com>
Cc: sup-devel@rubyforge.org
Subject: Re: [sup-devel] [sup-talk] Label Display; Sorting Alphabetically
Date: Mon, 21 Feb 2011 01:22:41 +0000 [thread overview]
Message-ID: <1298250926-sup-5020@whisper> (raw)
In-Reply-To: <1297863023-sup-4209@plc.intranet.plecavalier.com>
Excerpts from Philippe LeCavalier's message of Wed Feb 16 13:33:32 +0000 2011:
> > Philippe LeCavalier, 2011-02-15 17:37:
> > > Hi All. Just wondering if there has ever been any consideration to
> > > sorting labels alphabetically. I'm assuming the way sup displays the
> > > labels is purely esthetic's?
> >
> > I assume you are talking about thread index mode.
> No. Any mode really. Even in search mode they're random.
No longer! I've published a branch called order_labels that will fix
this, both in the various thread index modes, and when editing the
labels for a message. Diffs at the end of the email for your viewing
pleasure ...
I'll merge this into next when I'm a bit more awake - been up a bit long
...
Hamish Downer
commit 1ae7c0a1e5b20681ea6ecb9a6bf15fffa5f4c0e3
Author: Hamish Downer <dmishd@gmail.com>
Date: Sun Feb 20 22:57:47 2011 +0000
Order labels alphabetically in thread index mode
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
index 11548c7..36d6db3 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).sort_by {|x| x.to_s}.map { |label| [:label_color, "#{label} "] } +
[
[subj_color, t.subj + (t.subj.empty? ? "" : " ")],
[:snippet_color, t.snippet],
commit 490e57254c5ee493e8acf4b8358b54e7eb3ab698
Author: Hamish Downer <dmishd@gmail.com>
Date: Sun Feb 20 23:22:05 2011 +0000
When editing labels, they are presented in alphabetical order
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
index 36d6db3..613aa61 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -542,7 +542,7 @@ EOS
keepl, modifyl = thread.labels.partition { |t| speciall.member? t }
- user_labels = BufferManager.ask_for_labels :label, "Labels for thread: ", modifyl, @hidden_labels
+ user_labels = BufferManager.ask_for_labels :label, "Labels for thread: ", modifyl.sort_by {|x| x.to_s}, @hidden_labels
return unless user_labels
thread.labels = Set.new(keepl) + user_labels
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index 59705bc..e69de57 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -282,7 +282,7 @@ EOS
def edit_labels
old_labels = @thread.labels
reserved_labels = old_labels.select { |l| LabelManager::RESERVED_LABELS.include? l }
- new_labels = BufferManager.ask_for_labels :label, "Labels for thread: ", @thread.labels
+ new_labels = BufferManager.ask_for_labels :label, "Labels for thread: ", @thread.labels.sort_by {|x| x.to_s}
return unless new_labels
@thread.labels = Set.new(reserved_labels) + new_labels
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
parent reply other threads:[~2011-02-21 1:42 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1297863023-sup-4209@plc.intranet.plecavalier.com>]
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=1298250926-sup-5020@whisper \
--to=dmishd@gmail.com \
--cc=sup-devel@rubyforge.org \
--cc=support@plecavalier.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