summaryrefslogtreecommitdiffstats
path: root/test10.hs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-09-30 19:17:55 +0200
committertv <tv@krebsco.de>2020-10-06 10:56:09 +0200
commit5c6124815130174f7f39aacc33451c8562abccf1 (patch)
tree60589c0f4253a2ef5fd01ef4d7030907605e6e4c /test10.hs
parent38e3f53b5eb8e0958a355541626828c377370418 (diff)
test10: RIP
Diffstat (limited to 'test10.hs')
-rw-r--r--test10.hs44
1 files changed, 0 insertions, 44 deletions
diff --git a/test10.hs b/test10.hs
deleted file mode 100644
index 4889a59..0000000
--- a/test10.hs
+++ /dev/null
@@ -1,44 +0,0 @@
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-
---module Main (main) where
-
-import Control.Applicative
-import qualified Data.Text.Lazy as LT
-import qualified Data.Tree as Tree
-import MBox (MBox)
-import qualified MBox
-import System.Environment
-import System.Process
-
-
-notmuchShowMBox :: String -> IO MBox
-notmuchShowMBox searchTerm =
- MBox.parseMBox . LT.pack <$> readProcess
- "notmuch"
- [ "show"
- , "--format=mbox"
- , "--entire-thread=true"
- , searchTerm
- ]
- ""
-
-
-renderMessage :: MBox.Message -> String
-renderMessage msg =
- LT.unpack (MBox.getMessageId $ MBox.headers msg)
- ++ " "
- ++ drop (length ("From " :: String)) (LT.unpack $ MBox.fromLine msg)
-
-
-main :: IO ()
-main = do
- -- load-env hack
- maybe (return ()) (setEnv "HOME") =<< lookupEnv "OLDHOME"
-
- notmuchShowMBox "tree1" >>=
- putStrLn . Tree.drawTree .
- Tree.Node "subject:tree-test" .
- map (fmap renderMessage) .
- MBox.toForest