ormatIndexModeRows :: LazymailState -> [Email] -> [(FilePath, String)]
formatIndexModeRows st = map formatRow where
  formatRow e =
    let fp = emailPath e
        email = emailValue e
        hs = mime_val_headers email
        str = normalizeLen (screenColumns st) $ intercalate ppSep $
              [ "[" ++ normalizeLen maxFlags (ppFlags . getFlags $ fp) ++ "]"
              , formatDateTime "%b %d" $ emailDate e
              , normalizeLen fromLen $ ppField $ lookupField "from" hs
              , ppField $ lookupField "subject" hs
              ]
    in (fp, str)

formatIndexModeRows :: LazymailState -> [Email] -> [(FilePath, String)]
formatIndexModeRows st = map formatRow where
  formatRow e =
    let fp = emailPath e
        email = emailValue e
        hs = mime_val_headers email
        str = normalizeLen (screenColumns st) $ intercalate ppSep $
              [ "[" ++ normalizeLen maxFlags (ppFlags . getFlags $ fp) ++ "]"
              , formatDateTime "%b %d" $ emailDate e
              , normalizeLen fromLen $ ppField $ lookupField "from" hs
              , ppField $ lookupField "subject" hs
              ]
    in (fp, str)
formatIndexModeRows st = map formatRow where
  formatRow e =
    let fp = emailPath e
        email = emailValue e
        hs = mime_val_headers email
        str = normalizeLen (screenColumns st) $ intercalate ppSep $
              [ "[" ++ normalizeLen maxFlags (ppFlags . getFlags $ fp) ++ "]"
              , formatDateTime "%b %d" $ emailDate e
              , normalizeLen fromLen $ ppField $ lookupField "from" hs
              , ppField $ lookupField "subject" hs
              ]
    in (fp, str)