Skip to content

Commit

Permalink
Merge pull request haskell#7 from craigcitro/hoogle-cleanup
Browse files Browse the repository at this point in the history
Improve printing of hoogle output.
  • Loading branch information
pheaver committed Mar 20, 2012
2 parents dcff766 + 49a575a commit 071cb6f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions haskell-mode.el
Expand Up @@ -588,13 +588,15 @@ If nil, use the Hoogle web-site."
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-command
query)))))
(lexical-let ((temp-buffer (if (fboundp 'help-buffer) (help-buffer) "*Help*")))
(with-output-to-temp-buffer temp-buffer
(with-current-buffer standard-output
(let ((hoogle-process
(start-process "hoogle" (current-buffer) haskell-hoogle-command query))
(scroll-to-top
(lambda (process event)
(set-window-start (get-buffer-window temp-buffer t) 1))))
(set-process-sentinel hoogle-process scroll-to-top)))))))

;;;###autoload
(defalias 'hoogle 'haskell-hoogle)
Expand Down

0 comments on commit 071cb6f

Please sign in to comment.