ghc-mod 1.0.5 → 1.0.6
raw patch · 4 files changed
+17/−20 lines, 4 files
Files
- elisp/ghc-info.el +4/−2
- elisp/ghc-ins-mod.el +11/−16
- elisp/ghc.el +1/−1
- ghc-mod.cabal +1/−1
elisp/ghc-info.el view
@@ -56,8 +56,10 @@ (display-buffer buf))) (defun ghc-read-expression (default)- (let ((prompt (format "Expression (%s): " default)))- (read-string prompt default nil)))+ (if default+ (let ((prompt (format "Expression (%s): " default)))+ (read-string prompt default nil))+ (read-string "Expression: "))) (defun ghc-find-module-name () (save-excursion
elisp/ghc-ins-mod.el view
@@ -10,27 +10,22 @@ (defvar ghc-hoogle-command "hoogle") -(defvar ghc-hoogle-keywords '("data" "server" "combine" "convert" "test" "dump" "rank" "log"))- (defun ghc-insert-module () (interactive) (if (not (ghc-which ghc-hoogle-command)) (message "\"%s\" not found" ghc-hoogle-command) (let* ((expr0 (thing-at-point 'symbol)) (expr (ghc-read-expression expr0)))- (if (member expr ghc-hoogle-keywords)- (message "\"%s\" not allowed" expr)- (let ((mods (ghc-function-to-modules expr)))- (if (null mods)- (message "No module guessed")- (let* ((first (car mods))- (ini (cons first 0))- (mod (if (= (length mods) 1)- first- (completing-read "Module name: " mods nil t ini))))- (save-excursion- (ghc-goto-module-position)- (insert "import " mod "\n")))))))))+ (let ((mods (ghc-function-to-modules expr)))+ (if (null mods)+ (message "No module guessed")+ (let* ((first (car mods))+ (mod (if (= (length mods) 1)+ first+ (completing-read "Module name: " mods nil t first))))+ (save-excursion+ (ghc-goto-module-position)+ (insert "import " mod "\n")))))))) (defun ghc-goto-module-position () (goto-char (point-max))@@ -42,7 +37,7 @@ (defun ghc-function-to-modules (fn) (with-temp-buffer- (call-process ghc-hoogle-command nil t nil fn)+ (call-process ghc-hoogle-command nil t nil "search" fn) (goto-char (point-min)) (let ((regex (concat "^\\([a-zA-Z0-9.]+\\) " fn " ")) ret)
elisp/ghc.el view
@@ -16,7 +16,7 @@ ;;; Code: -(defconst ghc-version "1.0.5")+(defconst ghc-version "1.0.6") ;; (eval-when-compile ;; (require 'haskell-mode))
ghc-mod.cabal view
@@ -1,5 +1,5 @@ Name: ghc-mod-Version: 1.0.5+Version: 1.0.6 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3