C-M-d now can display functions and types in a browser.

This commit is contained in:
Kazu Yamamoto
2013-04-02 15:20:20 +09:00
parent 7749b1386b
commit 929026cb6d
4 changed files with 76 additions and 36 deletions

View File

@@ -147,11 +147,10 @@
(defconst ghc-error-buffer-name "*GHC Info*")
(defun ghc-display (fontify ins-func)
(let ((cdir default-directory)
(buf (get-buffer-create ghc-error-buffer-name)))
(let ((buf (get-buffer-create ghc-error-buffer-name)))
(with-current-buffer buf
(erase-buffer)
(funcall ins-func cdir)
(funcall ins-func)
(ghc-replace-character-buffer ghc-null ghc-newline)
(goto-char (point-min))
(if (not fontify)
@@ -160,4 +159,19 @@
(turn-on-haskell-font-lock)))
(display-buffer buf)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ghc-run-ghc-mod (cmds)
(cond
((executable-find ghc-module-command)
(let ((cdir default-directory))
(with-temp-buffer
(cd cdir)
(apply 'call-process ghc-module-command nil t nil
(append (ghc-make-ghc-options) cmds))
(buffer-substring (point-min) (1- (point-max))))))
(t
(message "%s not found" ghc-module-command)
nil)))
(provide 'ghc-func)