aboutsummaryrefslogtreecommitdiff
path: root/Config.hs
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2013-08-27 20:41:57 -0300
committerRaúl Benencia <rul@kalgan.cc>2013-08-27 20:41:57 -0300
commit32dc8cc98ef0e49e042d7d8cf000dc6360b106d6 (patch)
treeb55a3fa479756847a3db35d5eb4ae0b032592a1d /Config.hs
parentfab15274bae93611f85dd4cc221ce07b1661a081 (diff)
Unify selection list code
Diffstat (limited to 'Config.hs')
-rw-r--r--Config.hs16
1 files changed, 0 insertions, 16 deletions
diff --git a/Config.hs b/Config.hs
index 39f4371..1423d79 100644
--- a/Config.hs
+++ b/Config.hs
@@ -9,7 +9,6 @@
module Config(LazymailConfig(..), defaultConfig, customConfig) where
import Data.List(sort, stripPrefix)
-import System.FilePath(FilePath, takeFileName, dropTrailingPathSeparator)
import System.Posix.Files(getSymbolicLinkStatus, isSymbolicLink)
import UI.NCurses(Color(..))
@@ -20,7 +19,6 @@ data LazymailConfig = LazymailConfig {
, showStatusBar :: Bool
, initialPath :: FilePath
, filterMaildirsHook :: [FilePath] -> IO [FilePath]
- , maildirDrawHook :: String -> String -> String
}
defaultConfig = LazymailConfig {
@@ -30,7 +28,6 @@ defaultConfig = LazymailConfig {
, showStatusBar = True
, initialPath = ""
, filterMaildirsHook = \mds -> return mds
- , maildirDrawHook = \_ md -> md
}
--
@@ -41,21 +38,8 @@ defaultConfig = LazymailConfig {
--customConfig = defaultConfig { initialPath = "/home/rul/mail/"}
customConfig = defaultConfig { initialPath = "/home/rul/mail/linti"
- , maildirDrawHook = indentedShow
, filterMaildirsHook = filterSymlinks }
-indentedShow :: String -> String -> String
-indentedShow bp md =
- let str = case (stripPrefix bp md) of
- Nothing -> md
- Just s -> s
- name' = takeFileName . dropTrailingPathSeparator $ str
- name = takeFileName $ map (\x -> if x `elem` imapSep then '/' else x) name'
- pad = " "
- numPads = (length $ filter (== '/') str) + (length $ filter (`elem` imapSep) str)
- imapSep = ['.'] -- IMAP usually separates its directories with dots
- in (concat $ replicate (numPads - 1) pad) ++ name
-
filterSymlinks :: [FilePath] -> IO [FilePath]
filterSymlinks [] = return []
filterSymlinks (md:mds) = do
nihil fit ex nihilo