diff --git a/elisp/ghc-info.el b/elisp/ghc-info.el index 19aff23..b7b1987 100644 --- a/elisp/ghc-info.el +++ b/elisp/ghc-info.el @@ -14,10 +14,8 @@ (interactive "P") (if (not (ghc-which ghc-module-command)) (message "%s not found" ghc-module-command) - (let ((modname (ghc-find-module-name))) - (if (not modname) - (message "module should be specified") - (ghc-show-info0 ask modname))))) + (let ((modname (or (ghc-find-module-name) "Main"))) + (ghc-show-info0 ask modname)))) (defun ghc-show-info0 (ask modname) (let* ((expr0 (ghc-things-at-point)) @@ -87,10 +85,8 @@ (interactive) (if (not (ghc-which ghc-module-command)) (message "%s not found" ghc-module-command) - (let ((modname (ghc-find-module-name))) - (if (not modname) - (message "module should be specified") - (ghc-show-type0 modname))))) + (let ((modname (or (ghc-find-module-name) "Main"))) + (ghc-show-type0 modname)))) (defun ghc-show-type0 (modname) (let* ((buf (current-buffer))