defining ghc-executable-find.
This commit is contained in:
parent
0fac26e350
commit
63e59cbebd
@ -96,8 +96,7 @@ unloaded modules are loaded")
|
||||
;;;
|
||||
|
||||
(defun ghc-boot (n)
|
||||
(if (not (executable-find ghc-module-command))
|
||||
(message "%s not found" ghc-module-command)
|
||||
(ghc-executable-find ghc-module-command
|
||||
(ghc-read-lisp-list
|
||||
(lambda ()
|
||||
(message "Initializing...")
|
||||
@ -106,8 +105,7 @@ unloaded modules are loaded")
|
||||
n)))
|
||||
|
||||
(defun ghc-load-modules (mods)
|
||||
(if (not (executable-find ghc-module-command))
|
||||
(message "%s not found" ghc-module-command)
|
||||
(ghc-executable-find ghc-module-command
|
||||
(ghc-read-lisp-list
|
||||
(lambda ()
|
||||
(message "Loading names...")
|
||||
|
@ -162,16 +162,20 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun ghc-run-ghc-mod (cmds)
|
||||
(cond
|
||||
((executable-find ghc-module-command)
|
||||
(ghc-executable-find ghc-module-command
|
||||
(let ((cdir default-directory))
|
||||
(with-temp-buffer
|
||||
(cd cdir)
|
||||
(apply 'call-process ghc-module-command nil t nil
|
||||
(append (ghc-make-ghc-options) cmds))
|
||||
(buffer-substring (point-min) (1- (point-max))))))
|
||||
(t
|
||||
(message "%s not found" ghc-module-command)
|
||||
nil)))
|
||||
(buffer-substring (point-min) (1- (point-max)))))))
|
||||
|
||||
(defmacro ghc-executable-find (cmd &rest body)
|
||||
;; (declare (indent 1))
|
||||
`(if (not (executable-find ,cmd))
|
||||
(message "\"%s\" not found" ,cmd)
|
||||
,@body))
|
||||
|
||||
(put 'ghc-executable-find 'lisp-indent-function 1)
|
||||
|
||||
(provide 'ghc-func)
|
||||
|
@ -77,8 +77,7 @@
|
||||
|
||||
(defun ghc-show-type ()
|
||||
(interactive)
|
||||
(if (not (executable-find ghc-module-command))
|
||||
(message "%s not found" ghc-module-command)
|
||||
(ghc-executable-find ghc-module-command
|
||||
(let ((modname (or (ghc-find-module-name) "Main")))
|
||||
(ghc-show-type0 modname))))
|
||||
|
||||
|
@ -12,8 +12,7 @@
|
||||
|
||||
(defun ghc-insert-module ()
|
||||
(interactive)
|
||||
(if (not (executable-find ghc-hoogle-command))
|
||||
(message "\"%s\" not found" ghc-hoogle-command)
|
||||
(ghc-executable-find ghc-hoogle-command
|
||||
(let* ((expr0 (ghc-things-at-point))
|
||||
(expr (ghc-read-expression expr0)))
|
||||
(let ((mods (ghc-function-to-modules expr)))
|
||||
|
Loading…
Reference in New Issue
Block a user