def multi_toggle_deleted threads
    undos = threads.map { |t| actually_toggle_deleted t }
    UndoManager.register "deleting/undeleting #{threads.size.pluralize 'thread'}",
                         undos, lambda { regen_text }, lambda { threads.each { |t| Index.save_thread t } }
    regen_text
    threads.each { |t| Index.save_thread t }
  end
def multi_toggle_deleted threads
    undos = threads.map { |t| actually_toggle_deleted t }
    UndoManager.register "deleting/undeleting #{threads.size.pluralize 'thread'}",
                         undos, lambda { regen_text }, lambda { threads.each { |t| Index.save_thread t } }
    regen_text
    threads.each { |t| Index.save_thread t }
  end
see comment for multi_toggle_spam