def activate_chunk
    chunk = @chunk_lines[curpos] or return
    if chunk.is_a? Chunk::Text
      ## if the cursor is over a text region, expand/collapse the
      ## entire message
      chunk = @message_lines[curpos]
    end
    layout = if chunk.is_a?(Message)
      @layout[chunk]
    elsif chunk.expandable?
      @chunk_layout[chunk]
    end
    if layout
      layout.state = (layout.state != :closed ? :closed : :open)
      #cursor_down if layout.state == :closed # too annoying
      update
    elsif chunk.viewable?
      view chunk
    end
    if chunk.is_a?(Message) && $config[:jump_to_open_message]
      jump_to_message chunk
      jump_to_next_open if layout.state == :closed
    end
  end
def activate_chunk
    chunk = @chunk_lines[curpos] or return
    if chunk.is_a? Chunk::Text
      ## if the cursor is over a text region, expand/collapse the
      ## entire message
      chunk = @message_lines[curpos]
    end
    layout = if chunk.is_a?(Message)
      @layout[chunk]
    elsif chunk.expandable?
      @chunk_layout[chunk]
    end
    if layout
      layout.state = (layout.state != :closed ? :closed : :open)
      #cursor_down if layout.state == :closed # too annoying
      update
    elsif chunk.viewable?
      view chunk
    end
    if chunk.is_a?(Message) && $config[:jump_to_open_message]
      jump_to_message chunk
      jump_to_next_open if layout.state == :closed
    end
  end
called when someone presses enter when the cursor is highlighting
 a chunk. for expandable chunks (including messages) we toggle
 open/closed state; for viewable chunks (like attachments) we
 view.