From ef48d081dfd0e817c4959dbbd49929ae760a310e Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 31 Jan 2015 15:51:57 +0100 Subject: Notmuch: replace {un,}setTag by notmuchTag --- Notmuch.hs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'Notmuch.hs') 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 () -- cgit v1.2.3