From 549e0456737fa09cc960d227291038fdd4be7552 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Fri, 10 Aug 2012 09:10:42 +0900 Subject: [PATCH] Using executable-find instead of ghc-which. --- elisp/ghc-comp.el | 4 ++-- elisp/ghc-func.el | 11 ----------- elisp/ghc-info.el | 4 ++-- elisp/ghc-ins-mod.el | 2 +- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/elisp/ghc-comp.el b/elisp/ghc-comp.el index 592e00b..330906d 100644 --- a/elisp/ghc-comp.el +++ b/elisp/ghc-comp.el @@ -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 () diff --git a/elisp/ghc-func.el b/elisp/ghc-func.el index 936bcc0..5bac799 100644 --- a/elisp/ghc-func.el +++ b/elisp/ghc-func.el @@ -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) diff --git a/elisp/ghc-info.el b/elisp/ghc-info.el index 25f9af7..4ab0bee 100644 --- a/elisp/ghc-info.el +++ b/elisp/ghc-info.el @@ -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 diff --git a/elisp/ghc-ins-mod.el b/elisp/ghc-ins-mod.el index af3716d..9cd2326 100644 --- a/elisp/ghc-ins-mod.el +++ b/elisp/ghc-ins-mod.el @@ -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)))