asking expression.

This commit is contained in:
Kazu Yamamoto 2013-05-20 17:04:18 +09:00
parent 5959791e25
commit 92833da809
1 changed files with 7 additions and 3 deletions

View File

@ -15,10 +15,11 @@
(defun ghc-browse-document (&optional haskell-org) (defun ghc-browse-document (&optional haskell-org)
(interactive "P") (interactive "P")
(let ((mod0 (ghc-extract-module)) (let ((mod0 (ghc-extract-module))
(expr (ghc-things-at-point))) (expr0 (ghc-things-at-point)))
(cond (cond
((and (not mod0) expr) ((and (not mod0) expr0)
(let* ((info (ghc-get-info expr)) (let* ((expr (ghc-read-expression expr0))
(info (ghc-get-info expr0))
(mod (ghc-extact-module-from-info info)) (mod (ghc-extact-module-from-info info))
(pkg (ghc-resolve-package-name mod))) (pkg (ghc-resolve-package-name mod)))
(if (and pkg mod) (if (and pkg mod)
@ -105,6 +106,9 @@
(defun ghc-read-module-name (def) (defun ghc-read-module-name (def)
(read-from-minibuffer "Module name: " def ghc-input-map)) (read-from-minibuffer "Module name: " def ghc-input-map))
(defun ghc-read-expression (def)
(read-from-minibuffer "Expression: " def ghc-input-map))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ghc-extract-module () (defun ghc-extract-module ()