[xmonad] How to disable history in XMonad.Actions.Search.

Gwern Branwen gwern0 at gmail.com
Sun Sep 20 10:10:30 EDT 2009


On Sun, Sep 20, 2009 at 4:23 AM, Mike Sampson <mike at sambodata.com> wrote:
> Hi,
> I have recently started using XMonad.Actions.Search in conjunction
> with XMonad.Actions.Submap and am finding it very useful. I'm not
> overly keen on it presenting previous search terms in the prompt
> though and would like to turn them off somehow. I thought the easiest
> way would be to use the historyFilter field in XPConfig but am not
> having any luck. I have tried both of these:
>
> historyFilter = \x -> []
>
> and
>
> historyFilter =\[x] -> []

Code tip: you could also write '\_ -> []', or just 'const []'.

> Unfortunately my history is still saved to .xmonad/history and
> previous search terms are presented to me the next time I search. Is
> there an easy way to change this behaviour in xmonad.hs or would it
> mean a change to XMonad.Actions.Search?
>
> Regards,
>
> Mike

If you look in Search, you'll see:

{- | Like 'search', but for use with the output from a Prompt; it
grabs the
   Prompt's result, passes it to a given searchEngine and opens it in
a given
   browser. -}
promptSearchBrowser ∷  XPConfig →  Browser →  SearchEngine →  X ()
promptSearchBrowser config browser (SearchEngine name site) =
mkXPrompt (Search name) config historyCompletion $ search browser site

That is, 'config' is not asked for the history completion function nor
is any filter ran upon it; rather, it uses the canned
historyCompletion function from XMonad.Prompt.

It's possible to grab the historyFilter from the XPConfig that
promptSearchBrowser has access to; if you could test out my attached
patch?

-- 
gwern
-------------- next part --------------
A non-text attachment was scrubbed...
Name: search-filter.dpatch
Type: application/octet-stream
Size: 56210 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/xmonad/attachments/20090920/4c9afb43/search-filter-0001.obj


More information about the xmonad mailing list