summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Notmuch.hs4
-rw-r--r--TreeView.hs4
-rw-r--r--test3.hs4
3 files changed, 8 insertions, 4 deletions
diff --git a/Notmuch.hs b/Notmuch.hs
index 309f411..0d02782 100644
--- a/Notmuch.hs
+++ b/Notmuch.hs
@@ -114,7 +114,7 @@ showThread tid = do
Prelude.putStrLn $ showTree $ ttt
-getThread :: String -> IO (Tree Message)
+getThread :: String -> IO (Forest Message)
getThread tid = do
c' <- notmuch [ "show", "--format=json", "--format-version=2"
, "thread:" <> tid ]
@@ -123,7 +123,7 @@ getThread tid = do
Left err -> error err
Right x -> x
--threadsF = map threadForest threads
- ttt = head $ threadForest $ head $ threads
+ ttt = threadForest $ head $ threads
return ttt
diff --git a/TreeView.hs b/TreeView.hs
index 99bd843..f22ca35 100644
--- a/TreeView.hs
+++ b/TreeView.hs
@@ -99,6 +99,10 @@ fromSearchResults query =
Node (TVSearch query) . map (\r -> Node (TVSearchResult r) [])
+fromMessageForest :: Forest Message -> Forest TreeView
+fromMessageForest = map fromMessageTree
+
+
fromMessageTree :: Tree Message -> Tree TreeView
fromMessageTree (Node m ms) =
Node m' ms'
diff --git a/test3.hs b/test3.hs
index d122ce5..a7dc661 100644
--- a/test3.hs
+++ b/test3.hs
@@ -158,7 +158,7 @@ main' query =
TVSearchResult the_sr = Z.label sr
ThreadID tid = searchThread the_sr
- t_ <- return . (:[]) . fromMessageTree =<< getThread tid
+ t_ <- return . fromMessageForest =<< getThread tid
let loc' = Z.modifyTree (\(Node l _) -> Node l t_) sr
rec q { cursor = select (==Z.label cursor) loc' }
@@ -173,7 +173,7 @@ main' query =
t_ <-
if open
then return []
- else return . (:[]) . fromMessageTree =<< getThread tid
+ else return . fromMessageForest =<< getThread tid
let loc' = Z.modifyTree (\(Node l _) -> Node l t_) loc
rec q { cursor = select (==Z.label cursor) loc' }