def actually_toggle_archived t
    thread = t
    pos = curpos
    if t.has_label? :inbox
      t.remove_label :inbox
      UpdateManager.relay self, :archived, t.first
      lambda do
        thread.apply_label :inbox
        update_text_for_line pos
        UpdateManager.relay self,:unarchived, thread.first
      end
    else
      t.apply_label :inbox
      UpdateManager.relay self, :unarchived, t.first
      lambda do
        thread.remove_label :inbox
        update_text_for_line pos
        UpdateManager.relay self, :unarchived, thread.first
      end
    end
  end
def actually_toggle_archived t
    thread = t
    pos = curpos
    if t.has_label? :inbox
      t.remove_label :inbox
      UpdateManager.relay self, :archived, t.first
      lambda do
        thread.apply_label :inbox
        update_text_for_line pos
        UpdateManager.relay self,:unarchived, thread.first
      end
    else
      t.apply_label :inbox
      UpdateManager.relay self, :unarchived, t.first
      lambda do
        thread.remove_label :inbox
        update_text_for_line pos
        UpdateManager.relay self, :unarchived, thread.first
      end
    end
  end
returns an undo lambda