Using executable-find instead of ghc-which.
This commit is contained in:
parent
3861625420
commit
549e045673
@ -95,7 +95,7 @@ unloaded modules are loaded")
|
|||||||
;;;
|
;;;
|
||||||
|
|
||||||
(defun ghc-boot (n)
|
(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)
|
(message "%s not found" ghc-module-command)
|
||||||
(ghc-read-lisp-list
|
(ghc-read-lisp-list
|
||||||
(lambda ()
|
(lambda ()
|
||||||
@ -105,7 +105,7 @@ unloaded modules are loaded")
|
|||||||
n)))
|
n)))
|
||||||
|
|
||||||
(defun ghc-load-modules (mods)
|
(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)
|
(message "%s not found" ghc-module-command)
|
||||||
(ghc-read-lisp-list
|
(ghc-read-lisp-list
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
@ -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)
|
(defun ghc-uniq-lol (lol)
|
||||||
(let ((hash (make-hash-table :test 'equal))
|
(let ((hash (make-hash-table :test 'equal))
|
||||||
ret)
|
ret)
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
(defun ghc-show-type ()
|
(defun ghc-show-type ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (not (ghc-which ghc-module-command))
|
(if (not (executable-find ghc-module-command))
|
||||||
(message "%s not found" ghc-module-command)
|
(message "%s not found" ghc-module-command)
|
||||||
(let ((modname (or (ghc-find-module-name) "Main")))
|
(let ((modname (or (ghc-find-module-name) "Main")))
|
||||||
(ghc-show-type0 modname))))
|
(ghc-show-type0 modname))))
|
||||||
@ -134,7 +134,7 @@
|
|||||||
|
|
||||||
(defun ghc-display-information (cmds fontify)
|
(defun ghc-display-information (cmds fontify)
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (not (ghc-which ghc-module-command))
|
(if (not (executable-find ghc-module-command))
|
||||||
(message "%s not found" ghc-module-command)
|
(message "%s not found" ghc-module-command)
|
||||||
(ghc-display
|
(ghc-display
|
||||||
fontify
|
fontify
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
(defun ghc-insert-module ()
|
(defun ghc-insert-module ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (not (ghc-which ghc-hoogle-command))
|
(if (not (executable-find ghc-hoogle-command))
|
||||||
(message "\"%s\" not found" ghc-hoogle-command)
|
(message "\"%s\" not found" ghc-hoogle-command)
|
||||||
(let* ((expr0 (ghc-things-at-point))
|
(let* ((expr0 (ghc-things-at-point))
|
||||||
(expr (ghc-read-expression expr0)))
|
(expr (ghc-read-expression expr0)))
|
||||||
|
Loading…
Reference in New Issue
Block a user