[xmonad] Changes to XPrompt

Carlos López Camey c.lopez at kmels.net
Sun May 6 18:09:11 CEST 2012


Hello xmonaders,

I started to code something upon XPrompt, but I noticed that what I
would like the code to do, needs some changes in XPrompt, which I'm
not sure should go into XPrompt, or into a new type of Prompt (not
related to XPrompt). This question sometimes makes me doubt when
changing XPrompt.hs, so I thought I would ask and decide where to do
it.

The changes would be:
   * Autocomplete based on several modes (there is always a mode set)
         The autocomplete items are generally path to files, mode 1
could use for example `locate %s`, mode 2 `recollq` [0] (searches for
tokens inside files) and mode 3 `locate --regexp %s` to autocomplete.

   * one-column-only list of autocompletions
          For the purpose, they are always paths, so they are quite
large to keep it in different columns. But this be a setting on the
configuration.

   * Navigating through completion items and changing autocompletion
list on "real time"
            There is always an item highlighted (if items > 0)
            The highlighted item not necesarilly is equal to the
prompt buffer text. I may write "xmonad.hs" but the autocomplete item
shows a full path highlighted. This implies adding an additional field to
XPState, complIndex :: Int, that knows which item to highlight next (not
based on the buffer's text)

   * Action is not necesarilly a String -> X a.

      I'd like to count on a Map Extension (String -> String) in some
config, where type Extension = String. This map would describe what to
do with each file depending on its extension. e.g. an element of the
map could be (".org",\path -> "emacs "++path). So I'm not sure how the
new signature would be: String -> X a? but this String would be the
command sent to spawn, computed using a function that uses the map
described above.

I know this is a long list of features, but I hope it to be
materialized eventually. My questions would be then, is it right to do a new
XPrompt? it's hard not to think on changes braking current xmonad.hs
configurations.

In case a new Prompt is needed, name it LauncherPrompt, does it belong
to xmonad-contrib? Creating a new Prompt would imply having different
config types (XPConfig and LauncherPromptConfig), and very similar
actions on both each prompt module.. for example killBefore :: XP()
and killBefore :: LauncherP (). That's not acceptable IMHO.

I appreciate your comments,

[0] http://www.lesbonscomptes.com/recoll/



More information about the xmonad mailing list