Automatically add import lines via Hoogle

In similar vein to the other suggestion functionality, now, when "Not
in scope: `foo'" is seen, it will search hoogle for "foo" and if
hoogle returns any result "Foo.Bar foo :: a -> b" it will prompt:

Identifier `foo' not in scope, import `Foo.bar'? (y or n)

And then automatically insert an import for that module in the
offending file. The Hoogle executable needs to be installed for this,
which can be installed via

$ cabal install hoogle

and its database needs to be populated with

$ hoogle data

which will download some standard indexes from the Hackage servers. If
you want Hoogle on all your installed packages and your local
codebase, it's not straight-forward, for reasons unknown.

@hvr might be of interest.
Make dummy global binding to avoid not-in-scope warnings
Automatically add package to cabal file

GHC will often give a message like

Foo.hs:16:18:
    Could not find module `System.Directory'
    It is a member of the hidden package `directory-1.1.0.2'.
    Perhaps you need to add `directory' to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.

when you use a module that belongs to a package that isn't in your
cabal file. The haskell process can now prompt you to begin a
process that will add the package to your .cabal file.

Foo.hs:16:18: Could not find module `System.Directory' [ It is a me
.. ]

Add `directory' to some-package.cabal? (y or n)  y

That process can also manually be started with M-x haskell-process-add-dependency

It goes thus:

Package entry: directory >= 1.1.0.2

(that is a prompt, you can edit the package entry there)

Then it switches to the cabal file, and jumps to each build target in
the file, prompting first the library--if there is a library entry:

Add to library? (y or n)  y

And then executables:

Add to executable `some-executable'? (y or n)  y

It will insert the dependency at the top of the build-depends list,
and try to re-indent the item that it knocked off back into the same
level of indentation.

Once all targets are done, it saves the .cabal file and switches back
to the buffer you were originally in.

@hvr might be of interest.
Support the case of multiple available modules for auto-import

In the case of multiple imports e.g. $ has Prelude and Data.Function

it will prompt with ido-completing-read the module to import.
Ignore package results
Make navigate-imports a bit more useful in absense of import list

If there is no import list it will try to jump to one blank line after
the module header.
Strip out M./S./L. typical module prefixes for suggestion functionality
Better "not in scope" detection

This ignores the “type constructor or classtype constructor or class” stuff.
Support god-mode on SPC key
Don't use replace-regexp to appease make check
Allow whitespace before settings.
Check for build/install as substring

Sometimes you might run C-c c (cabal command) and then type build
--ghc-options=-fforce-recomp, but then it wouldn't've been treated as
a build process and compiling/messages wouldn't be handled
specially. So this patch just checks for the prefix "build" or
"install" and then ignores anything afterwards.
Make errors expanded by default
Make showing debugging tips an option
Option to automatically chmod .ghci files that GHCi ignores

.ghci files are a convenience facility. GHCi decides out of security
concerns that it will simply ignore convenience files. For an
interactive application, this is pretty stupid. The better approach
is the approach that Emacs takes, which is to prompt the user and
allow them to decide conveniently.

This patch collects all files that GHCi warns that it has ignored into
a list, the user is given a message like this:

GHCi is ignoring: /home/chris/foo (run M-x haskell-process-unignore)
GHCi is ignoring: /home/chris/foo/.ghci (run M-x haskell-process-unignore)

When they run `M-x haskell-process-unignore', they get:

Set permissions? /home/chris/foo/.ghci (y, n, v: stop and view file) y
Permissions command: chmod 700 /home/chris/foo/.ghci

This allows the user to edit the permissions command per file, if
desired, or they can just hit RET. They also have the option to stop
this procedure and view the file first.

At the end, it prompts the user to restart the process for the
changes (if any) to take effect.

This is not portable to Windows. There apparently is some command for
Windows for setting permissions but it's difficult to know how
reliable it is and I don't have a Windows machine to test on. Instead,
I include a note in the function for Windows-using Emacs hackers to
further extend it.

@hvr might be of interest.
Use && instead of ; because this works on Windows, too (refs #232)
Separate running a line in haskell-interactive-mode into another function

No actual change in functionality here, this is in anticipation of
further changes.
Fix dynamic-binding reference
Ability to configure the import line on suggestions
Remove EOF newline. These are explicit in snippets.