17

It's quite nice to have ghci integrated with Emacs through inferior-haskell-mode: this adds a wonderful possibility to quickly navigate to compile error locations, interactively inspect types, definitions, etc. Nevertheless, the major feature I'm missing in this setup is inability to use ghci tab-completion, which is quite helpful for completing functions available from imported modules, language extensions and ghci commands.

I assume that this functionality may be implemented rather trivially by passing raw "TAB" character to the ghci process, reading its output back and pasting the result into the Emacs buffer. Note that I haven't worked with "comint-mode" in Emacs, so I may be totally wrong.

Finally, we have come to my question: why this feature is missing from haskell-mode? Are there any obvious problems which I am unaware of, is it hard to implement, or is it just due to some historical reasons? (like "no one bothered to write it"). Do you have any workarounds for the problem? (except running ghci outside Emacs)

dying_sphynx
  • 1,136
  • 8
  • 17

1 Answers1

6

Check out ghc-mode that builds on top of haskell-mode and adds autocompletion and some other features.

There's also a haskell-emacs mode, which is different from haskell-mode. It also has autocompletion. Although it was quirky and not always worked when i tried it.

Vagif Verdi
  • 4,816
  • 1
  • 26
  • 31
  • 1
    I've just installed ghc-mod, I like its autocompletion and hlint integration (although I have to play with it a little bit to tune to my needs). But still, its autocompletion does not work properly in ghci buffer: as far as I understand "ghc-complete" function analyses current buffer (to find imports) and ghci buffer is not what it expects. So it suggests only some keywords and ignores any ":m + Data.List" which I type in ghci buffer. – dying_sphynx Feb 25 '12 at 12:18
  • I have also tried "haskell-emacs" from Chris Done, but it is not quite documented these days (since it's still in beta), so I decided to come back a little bit later. – dying_sphynx Feb 25 '12 at 12:19