## overwrite toggle_archived with archive
k.add :archive, "Archive thread (remove from inbox)", 'a'
k.add :read_and_archive, "Archive thread (remove from inbox) and mark read", 'A'
+ k.add :refine_search, "Refine search", '|'
+ end
+
+ def self.newest_first
+ if !$config[:inbox_newest_first].nil?
+ $config[:inbox_newest_first]
+ else
+ true
+ end
end
def initialize
super [:inbox, :sent, :draft], { :label => :inbox, :skip_killed => true }
raise "can't have more than one!" if defined? @@instance
@@instance = self
+ @newest_first = InboxMode.newest_first
end
def is_relevant? m; (m.labels & [:spam, :deleted, :killed, :inbox]) == Set.new([:inbox]) end
+ def refine_search
+ text = BufferManager.ask :search, "refine query: ", "label:inbox AND "
+ return unless text && text !~ /^\s*$/
+ SearchResultsMode.spawn_from_query text, @newest_first
+ end
+
## label-list-mode wants to be able to raise us if the user selects
## the "inbox" label, so we need to keep our singletonness around
def self.instance; @@instance; end