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)
|
(defun ghc-boot (n)
|
||||||
(if (not (executable-find ghc-module-command))
|
(ghc-executable-find ghc-module-command
|
||||||
(message "%s not found" ghc-module-command)
|
|
||||||
(ghc-read-lisp-list
|
(ghc-read-lisp-list
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(message "Initializing...")
|
(message "Initializing...")
|
||||||
@ -106,8 +105,7 @@ unloaded modules are loaded")
|
|||||||
n)))
|
n)))
|
||||||
|
|
||||||
(defun ghc-load-modules (mods)
|
(defun ghc-load-modules (mods)
|
||||||
(if (not (executable-find ghc-module-command))
|
(ghc-executable-find ghc-module-command
|
||||||
(message "%s not found" ghc-module-command)
|
|
||||||
(ghc-read-lisp-list
|
(ghc-read-lisp-list
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(message "Loading names...")
|
(message "Loading names...")
|
||||||
|
@ -162,16 +162,20 @@
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(defun ghc-run-ghc-mod (cmds)
|
(defun ghc-run-ghc-mod (cmds)
|
||||||
(cond
|
(ghc-executable-find ghc-module-command
|
||||||
((executable-find ghc-module-command)
|
|
||||||
(let ((cdir default-directory))
|
(let ((cdir default-directory))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(cd cdir)
|
(cd cdir)
|
||||||
(apply 'call-process ghc-module-command nil t nil
|
(apply 'call-process ghc-module-command nil t nil
|
||||||
(append (ghc-make-ghc-options) cmds))
|
(append (ghc-make-ghc-options) cmds))
|
||||||
(buffer-substring (point-min) (1- (point-max))))))
|
(buffer-substring (point-min) (1- (point-max)))))))
|
||||||
(t
|
|
||||||
(message "%s not found" ghc-module-command)
|
(defmacro ghc-executable-find (cmd &rest body)
|
||||||
nil)))
|
;; (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)
|
(provide 'ghc-func)
|
||||||
|
@ -77,8 +77,7 @@
|
|||||||
|
|
||||||
(defun ghc-show-type ()
|
(defun ghc-show-type ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (not (executable-find ghc-module-command))
|
(ghc-executable-find 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))))
|
||||||
|
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
|
|
||||||
(defun ghc-insert-module ()
|
(defun ghc-insert-module ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (not (executable-find ghc-hoogle-command))
|
(ghc-executable-find 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)))
|
||||||
(let ((mods (ghc-function-to-modules expr)))
|
(let ((mods (ghc-function-to-modules expr)))
|
||||||
|
Loading…
Reference in New Issue
Block a user