EDIT I'm using GNU Emacs 23.0.95.1 and Haskell-mode 2.4, both from ports
I used to use vim all the time, but have fallen in love with emacs and it's extensibility. I installed haskell-mode from ports on my FreeBSD 7.2 system, and everything seems to work fine so far except for the function haskell-hoogle. When I call the function it creates a new window that just says "Process hoogle finished" with no other content. Here is the code for the function for those who aren't familiar
(defcustom haskell-hoogle-command
(if (executable-find "hoogle") "hoogle"))
(defun haskell-hoogle (query)
"Do a Hoogle search for QUERY"
(interactive
(let ((def (haskell-ident-at-point)))
(if (and def (symbolp def)) (setq def (symbol-name def)))
(list (read-string (if def
(format "Hoogle query (default %s): " def)
"Hoogle query: ")
nil nil def))))
(if (null haskell-hoogle-command)
(browse-url (format "http://haskell.org/hoogle/?q=%s" query))
(if (fboundp 'help-setup-xref)
(help-setup-xref (list 'haskell-hoogle query) (interactive-p)))
(with-output-to-temp-buffer
(if (fboundp 'help-buffer) (help-buffer) "*Help*")
(with-current-buffer standard-output
(start-process "hoogle" (current-buffer) haskell-hoogle-commmand
query)))))
However, I have found that if print something to the temporary buffer just before the hoogle process is started then I get the expected output from hoogle. The following code produces the output, but it is prefixed with "" because of the call to print:
(defun haskell-hoogle (query)
"Do a Hoogle search for QUERY"
(interactive
(let ((def (haskell-ident-at-point)))
(if (and def (symbolp def)) (setq def (symbol-name def)))
(list (read-string (if def
(format "Hoogle query (default %s): " def)
"Hoogle query: ")
nil nil def))))
(if (null haskell-hoogle-command)
(browse-url (format "http://haskell.org/hoogle/?q=%s" query))
(if (fboundp 'help-setup-xref)
(help-setup-xref (list 'haskell-hoogle query) (interactive-p)))
(with-output-to-temp-buffer
(if (fboundp 'help-buffer) (help-buffer) "*Help*")
(print "")
(with-current-buffer standard-output
(start-process "hoogle" (current-buffer) haskell-hoogle-commmand
query)))))
I would like to figure out what's going on here; is there a problem with the haskell-mode code, is there something wrong with my system. I would really appreciate a bit of advice
Thanks James