[xmonad] Two patches related to XMonad.Prompt

Brent Yorgey byorgey at gmail.com
Wed Apr 15 13:18:18 UTC 2015


OK, I've made some progress figuring out what is going on.  In short: the
searchPredicate field is never used in XMonad.Prompt!  The only place the
searchPredicate is used is in XMonad.Prompt.Window, in the definition of
the doPrompt function.  So this will work if you happen to be using a
prompt to pick a window, but not for any other sort of prompt.

This actually seems like a bug in XMonad.Prompt.  At some point someone
added a searchPredicate field to the XPConfig, but forgot to actually use
it to filter completion results.

Norbert, is this something you could look into?  I've looked through
XMonad.Prompt briefly but not sure where the right place is for this to
go.  I'll probably get around to it eventually if no one else does.

-Brent

On Fri, Apr 3, 2015 at 6:08 PM Brent Yorgey <byorgey at gmail.com> wrote:

> Hmm, I tried it out but can't seem to get it to work.  Mysterious.  The
> patches are definitely applied, my xmonad.hs includes definitions for
> sorter and searchPredicate, it compiles cleanly, but when I open a prompt
> it has the same behavior as before.
>
> I'll try to spend some more time tracking down what is going on but just
> wanted to briefly report.
>
> -Brent
>
> On Mon, Mar 23, 2015 at 2:39 PM Brent Yorgey <byorgey at gmail.com> wrote:
>
>>
>>
>> ---------- Forwarded message ---------
>> From: Norbert Zeh <nzeh at cs.dal.ca>
>> Date: 12:59pm, Sat, Mar 14, 2015
>> Subject: [xmonad] Two patches related to XMonad.Prompt
>> To: xmonad at haskell.org <xmonad at haskell.org>
>>
>>
>> Hi folks,
>>
>> I really got used to using emacs ido mode, which offers a pretty powerful
>> and intuitive fuzzy matching of completions, so I wanted to port the same
>> to XMonad.Prompt.  This required two patches, included in the attached
>> patch bundles:
>>
>> (1)  Completions should be sortable by how well they match the current
>> query string.  This turned out to be a very easy addition of a 'sorter'
>> function to XPConfig, which is parameterized by the current query string.
>> The default is 'const id', that is, no sorting is done, which is exactly
>> the old behaviour of XMonad.Prompt.
>>
>> (2)  A new module XMonad.Prompt.FuzzyMatch that implements the fuzzy
>> matching.  The exact rules for matching and sorting of matches are
>> explained in its documentation.
>>
>> As usual, let me know if anything needs to straightened out before these
>> patches can be applied.
>>
>> Cheers,
>> Norbert
>> _______________________________________________
>> xmonad mailing list
>> xmonad at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20150415/93909237/attachment.html>


More information about the xmonad mailing list