user_label = bm.ask_with_completions :label, "Show threads with label (enter for listing): ", labels
user_label = bm.spawn_modal("Label list", LabelListMode.new) if user_label && user_label.empty?
- label = LabelManager.label_for user_label if user_label
- case label
+ case user_label
when nil
when :inbox
BufferManager.raise_to_front InboxMode.instance.buffer
else
b = BufferManager.spawn_unless_exists("All threads with label '#{user_label}'") do
- mode = LabelSearchResultsMode.new([label])
+ mode = LabelSearchResultsMode.new([user_label])
end
b.mode.load_threads :num => b.content_height
end
for next release
----------------
+_ mailing list subscribe/unsubscribe
_ BufferManager#ask_for_labels opens up label-list-mode if empty
_ tab completion for mid-text cursors
_ forward attachments
_ messages as attachments
_ individual labeling in thread-view-mode
_ tab completion for to: and cc: in compose-mode
-_ translate aliases in queries on to: and from: fields
_ use trac or something. this file is getting a little silly.
_ gpg integration
_ user-defined hooks
_ gmail support
_ warnings: top-posting, missing attachment, ruby-talk:XXXX detection
_ Net::SMTP support
+x translate aliases in queries on to: and from: fields
x tab completion on labeling
future
def regen_text
@text = []
- @labels = LabelManager.listable_labels
+ labels = LabelManager.listable_labels
- counts = @labels.map do |label|
+ counts = labels.map do |label|
string = LabelManager.string_for label
total = Index.num_results_for :label => label
unread = Index.num_results_for :labels => [label, :unread]
end.sort_by { |l, s, t, u| s.downcase }
width = counts.max_of { |l, s, t, u| s.length }
+ @labels = counts.map { |l, s, t, u| l }
counts.map do |label, string, total, unread|
if total == 0 && !LabelManager::RESERVED_LABELS.include?(label)