Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7 from craigcitro/hoogle-cleanup

Improve printing of hoogle output.
  • Loading branch information...
commit 071cb6ffbe286173d21b38451e80a4d3a3743682 2 parents dcff766 + 49a575a
@pheaver authored
Showing with 9 additions and 7 deletions.
  1. +9 −7 haskell-mode.el
16 haskell-mode.el
@@ -588,13 +588,15 @@ If nil, use the Hoogle web-site."
nil nil def))))
(if (null haskell-hoogle-command)
(browse-url (format "" 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)))))))
(defalias 'hoogle 'haskell-hoogle)
Please sign in to comment.
Something went wrong with that request. Please try again.