Main is passed if not exist.

This commit is contained in:
Kazu Yamamoto 2012-02-16 14:50:15 +09:00
parent f3725127bc
commit b9f5c8f9f4

View File

@ -14,10 +14,8 @@
(interactive "P") (interactive "P")
(if (not (ghc-which ghc-module-command)) (if (not (ghc-which ghc-module-command))
(message "%s not found" ghc-module-command) (message "%s not found" ghc-module-command)
(let ((modname (ghc-find-module-name))) (let ((modname (or (ghc-find-module-name) "Main")))
(if (not modname) (ghc-show-info0 ask modname))))
(message "module should be specified")
(ghc-show-info0 ask modname)))))
(defun ghc-show-info0 (ask modname) (defun ghc-show-info0 (ask modname)
(let* ((expr0 (ghc-things-at-point)) (let* ((expr0 (ghc-things-at-point))
@ -87,10 +85,8 @@
(interactive) (interactive)
(if (not (ghc-which ghc-module-command)) (if (not (ghc-which ghc-module-command))
(message "%s not found" ghc-module-command) (message "%s not found" ghc-module-command)
(let ((modname (ghc-find-module-name))) (let ((modname (or (ghc-find-module-name) "Main")))
(if (not modname) (ghc-show-type0 modname))))
(message "module should be specified")
(ghc-show-type0 modname)))))
(defun ghc-show-type0 (modname) (defun ghc-show-type0 (modname)
(let* ((buf (current-buffer)) (let* ((buf (current-buffer))