summaryrefslogtreecommitdiffstats
path: root/Notmuch.hs
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-01-31 15:51:57 +0100
committertv <tv@shackspace.de>2015-01-31 15:51:57 +0100
commitef48d081dfd0e817c4959dbbd49929ae760a310e (patch)
tree54867be238b6f8707a43fa7af6d16d3f59144f73 /Notmuch.hs
parent39e76d0c83515a98f84f06b1c3b430d1e67cd1cd (diff)
Notmuch: replace {un,}setTag by notmuchTag
Diffstat (limited to 'Notmuch.hs')
-rw-r--r--Notmuch.hs13
1 files changed, 5 insertions, 8 deletions
diff --git a/Notmuch.hs b/Notmuch.hs
index c39c4c0..eb839fd 100644
--- a/Notmuch.hs
+++ b/Notmuch.hs
@@ -10,11 +10,13 @@ import Control.Exception
import Data.Aeson
import Data.Monoid
import Data.Tree
+import Notmuch.Class
import Notmuch.Message
import Notmuch.SearchResult
import System.Exit
import System.IO
import System.Process
+import TagUtils
-- | Fork a thread while doing something else, but kill it if there's an
@@ -177,11 +179,6 @@ notmuchShowPart term partId = do
_ -> Left $ show exitCode <> ": " <> LBS8.unpack err
-setTag :: String -> String -> IO LBS.ByteString
-setTag tag i = do
- notmuch [ "tag", "+" <> tag , i ]
-
-
-unsetTag :: String -> String -> IO LBS.ByteString
-unsetTag tag i = do
- notmuch [ "tag", "-" <> tag , i ]
+notmuchTag :: HasNotmuchId a => [TagOp] -> a -> IO ()
+notmuchTag tagOps x =
+ notmuch ("tag" : tagOpsToArgs tagOps ++ [notmuchId x]) >> return ()