From 5493ff190d0d5e207dde07139fd371f8057d9e93 Mon Sep 17 00:00:00 2001 From: slotThe Date: Sun, 19 Jan 2020 22:08:48 +0100 Subject: [PATCH 1/2] Add promptSearchBrowser' to further filter suggestions Users may suggesting previous searches if and only if they came from the same search engine more natural. --- XMonad/Actions/Search.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/XMonad/Actions/Search.hs b/XMonad/Actions/Search.hs index 7a7bf8b1..8c5c6c7e 100644 --- a/XMonad/Actions/Search.hs +++ b/XMonad/Actions/Search.hs @@ -18,6 +18,7 @@ module XMonad.Actions.Search ( -- * Usage searchEngineF, promptSearch, promptSearchBrowser, + promptSearchBrowser', selectSearch, selectSearchBrowser, isPrefixOf, @@ -361,6 +362,18 @@ promptSearchBrowser :: XPConfig -> Browser -> SearchEngine -> X () promptSearchBrowser config browser (SearchEngine name site) = mkXPrompt (Search name) config (historyCompletionP ("Search [" `isPrefixOf`)) $ search browser site +{- | Like 'promptSearchBrowser', but only suggest previous searches for the + given 'SearchEngine' in the prompt. -} +promptSearchBrowser' :: XPConfig -> Browser -> SearchEngine -> X () +promptSearchBrowser' config browser (SearchEngine name site) = + mkXPrompt + (Search name) + config + (historyCompletionP (searchName `isPrefixOf`)) + $ search browser site + where + searchName = showXPrompt (Search name) + {- | Like 'search', but in this case, the string is not specified but grabbed from the user's response to a prompt. Example: From eacd20ad006af34e547edb564ac4af74576fa6ba Mon Sep 17 00:00:00 2001 From: slotThe Date: Sun, 19 Jan 2020 22:22:50 +0100 Subject: [PATCH 2/2] Update CHANGES.md --- CHANGES.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a29f99c1..93b68e18 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -51,8 +51,10 @@ * `XMonad.Actions.Search` - The `hoogle` function now uses the new URL `hoogle.haskell.org`. - + - The `hoogle` function now uses the new URL `hoogle.haskell.org`. + - Added `promptSearchBrowser'` function to only suggest previous searches of + the selected search engine (instead of all search engines). + * `XMonad.Layout.BoringWindows` Added 'markBoringEverywhere' function, to mark the currently