From 74b281b5d331156520d7dbe7a0b863a79d8e18e8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 4 Jan 2017 14:39:00 -0700 Subject: [PATCH 1/2] Use the new getXMonadCacheDir function from #62 Prompt should have been using getXMonadDir this entire time but since we now have getXMonadCacheDir use that instead. This brings xmonad-contrib inline with the changes in #62. This also fixes xmonad/xmonad-contrib#68 --- XMonad/Prompt.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index ae5250b3..1c040e02 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -91,7 +91,6 @@ import Data.List import qualified Data.Map as M import Data.Maybe (fromMaybe) import Data.Set (fromList, toList) -import System.Directory (getAppUserDataDirectory) import System.IO import System.Posix.Files @@ -1064,7 +1063,7 @@ emptyHistory :: History emptyHistory = M.empty getHistoryFile :: IO FilePath -getHistoryFile = fmap (++ "/history") $ getAppUserDataDirectory "xmonad" +getHistoryFile = fmap (++ "/prompt-history") getXMonadCacheDir readHistory :: IO History readHistory = readHist `E.catch` \(SomeException _) -> return emptyHistory @@ -1170,7 +1169,7 @@ breakAtSpace s -- | 'historyCompletion' provides a canned completion function much like -- 'getShellCompl'; you pass it to mkXPrompt, and it will make completions work --- from the query history stored in ~\/.xmonad\/history. +-- from the query history stored in the XMonad cache directory. historyCompletion :: ComplFunction historyCompletion = historyCompletionP (const True) From 4dd60756ea75bb3b89886394490b9b813f3b346b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 4 Jan 2017 14:47:20 -0700 Subject: [PATCH 2/2] Update the change log --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 0fa52a3f..989e9568 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,9 @@ * New constructor `CenteredAt Rational Rational` added for `XMonad.Prompt.XPPosition`. + * `XMonad.Prompt` now stores its history file in the XMonad cache + directory in a file named `prompt-history`. + ### New Modules * `XMonad.Layout.SortedLayout`