Using executable-find instead of ghc-which.

This commit is contained in:
Kazu Yamamoto 2012-08-10 09:10:42 +09:00
parent 3861625420
commit 549e045673
4 changed files with 5 additions and 16 deletions

View File

@ -95,7 +95,7 @@ unloaded modules are loaded")
;;;
(defun ghc-boot (n)
(if (not (ghc-which ghc-module-command))
(if (not (executable-find ghc-module-command))
(message "%s not found" ghc-module-command)
(ghc-read-lisp-list
(lambda ()
@ -105,7 +105,7 @@ unloaded modules are loaded")
n)))
(defun ghc-load-modules (mods)
(if (not (ghc-which ghc-module-command))
(if (not (executable-find ghc-module-command))
(message "%s not found" ghc-module-command)
(ghc-read-lisp-list
(lambda ()

View File

@ -49,17 +49,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ghc-which (cmd)
(catch 'loop
(dolist (suffix '("" ".exe"))
(let ((cmds (concat cmd suffix)))
(dolist (dir exec-path)
(let ((path (expand-file-name cmds dir)))
(if (file-exists-p path)
(throw 'loop path))))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ghc-uniq-lol (lol)
(let ((hash (make-hash-table :test 'equal))
ret)

View File

@ -70,7 +70,7 @@
(defun ghc-show-type ()
(interactive)
(if (not (ghc-which ghc-module-command))
(if (not (executable-find ghc-module-command))
(message "%s not found" ghc-module-command)
(let ((modname (or (ghc-find-module-name) "Main")))
(ghc-show-type0 modname))))
@ -134,7 +134,7 @@
(defun ghc-display-information (cmds fontify)
(interactive)
(if (not (ghc-which ghc-module-command))
(if (not (executable-find ghc-module-command))
(message "%s not found" ghc-module-command)
(ghc-display
fontify

View File

@ -12,7 +12,7 @@
(defun ghc-insert-module ()
(interactive)
(if (not (ghc-which ghc-hoogle-command))
(if (not (executable-find ghc-hoogle-command))
(message "\"%s\" not found" ghc-hoogle-command)
(let* ((expr0 (ghc-things-at-point))
(expr (ghc-read-expression expr0)))